Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@parcel/resolver-default: Cannot load file #7726

Closed
motionrus opened this issue Feb 17, 2022 · 2 comments
Closed

@parcel/resolver-default: Cannot load file #7726

motionrus opened this issue Feb 17, 2022 · 2 comments

Comments

@motionrus
Copy link

I have error when try use dependency resolution
My tsconfig is

{
  "compilerOptions": {
    "baseUrl": ".",
    "paths": {
      "~*": ["./src/*"]
    },
    "target": "es2019",
    "lib": [
      "dom",
      "dom.iterable",
      "esnext"
    ],
    "sourceMap": true,
    "allowJs": true,
    "skipLibCheck": true,
    "esModuleInterop": true,
    "allowSyntheticDefaultImports": true,
    "strict": true,
    "forceConsistentCasingInFileNames": true,
    "noFallthroughCasesInSwitch": true,
    "module": "esnext",
    "moduleResolution": "node",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "noEmit": true,
    "jsx": "react-jsx",
    "outDir": "lib"
  },
  "include": ["src/**/*"]
}

My error is

@parcel/core: Failed to resolve '~/features/image/imageSlice' from './src/tools/Table/Canvas.tsx'

  /Users/a18663613/Projects/trash/markup-tools/src/tools/Table/Canvas.tsx:6:23
    5 | import {useAppSelector} from "../../hooks";
  > 6 | import {setSize} from "~/features/image/imageSlice";
  >   |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    7 | 
    8 | 

@parcel/resolver-default: Cannot load file '../../../features/image/imageSlice' in './src/tools/Table'.
💡 Did you mean '../../features/image/imageSlice'?
💡 Did you mean '../../features/image/BaseImage'?

My project tree

a18663613@CAB-WSM-0006132:~/Projects/trash/markup-tools$ tree -L 1
.
├── README.md
├── build
├── markup-tools-0.1.0.tgz
├── node_modules
├── package-lock.json
├── package.json
├── public
├── src
└── tsconfig.json
@mischnic
Copy link
Member

Parcel doesn't apply the paths settings in tsconfig. Something like #4936 would enable this

@mischnic mischnic closed this as not planned Won't fix, can't repro, duplicate, stale Jun 20, 2022
@Carreau
Copy link

Carreau commented Oct 5, 2023

Likely unrelated, but as google sent me to this page first when googling.

For me this was due to the new resolver that did not found ESM module by default. The solution was to set this options describe in the blog post announcement:

  // add to package.json
  "@parcel/resolver-default": {
    "packageExports": true
  }

Anto59290 added a commit to MTES-MCT/acceslibre that referenced this issue Oct 24, 2023
Update the project to parcel 2 instead of parcel-bundler (parcel 1).

Issues and documentation:

- DSFR Css is not valid :
GouvernementFR/dsfr#576 (thanks @rik for the
issue)
- Fix images paths : parcel-bundler/parcel#7726
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants