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

[plugin:vite:import-analysis] Failed to resolve import xxx Does the file exist? #1566

Closed
2 of 3 tasks
leopsidom opened this issue Jan 16, 2021 · 1 comment · Fixed by #1568
Closed
2 of 3 tasks

[plugin:vite:import-analysis] Failed to resolve import xxx Does the file exist? #1566

leopsidom opened this issue Jan 16, 2021 · 1 comment · Fixed by #1568

Comments

@leopsidom
Copy link

leopsidom commented Jan 16, 2021

⚠️ IMPORTANT ⚠️ Please check the following list before proceeding. If you ignore this issue template, your issue will be directly closed.

  • Read the docs.
  • Use Vite >=2.0. (1.x is no longer supported)
  • If the issue is related to 1.x -> 2.0 upgrade, read the Migration Guide first.

Describe the bug

Trying to import jexcel which requires another module and css file internally, which causes the error as in title.

Reproduction

https://github.com/leopsidom/vite-jexcel-import-error

  • git clone
  • npm install
  • npm run dev

System Info

  • vite version: 2.0.0-beta.12
  • Operating System: Windows 10
  • Node version: v14.2.0
  • Package manager (npm/yarn/pnpm) and version: npm 6.14.4

Logs (Optional if provided reproduction)

[plugin:vite:import-analysis] Failed to resolve import "jsuites/dist/jsuites.css?commonjs-require". Does the file exist?

ps: when looking into the actual file, there's an extra question mark character in front of jsuites/dist/jsuites.css?commonjs-require, which I think causes the error, but don't know why it's added.

underfin added a commit to rolldown/vite that referenced this issue Jan 17, 2021
…monjs` will inject require suffix for require call

fix vitejs#1566
@underfin
Copy link
Member

Except #1568, you should include jsuites at optimizeDeps.

@github-actions github-actions bot locked and limited conversation to collaborators Jul 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants