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

Error after creating project using npm init slidev@latest #968

Closed
bram-pkg opened this issue Apr 20, 2023 · 8 comments
Closed

Error after creating project using npm init slidev@latest #968

bram-pkg opened this issue Apr 20, 2023 · 8 comments

Comments

@bram-pkg
Copy link
Contributor

Describe the bug
After creating a new project using npm init slidev@latest, the following occurs:

Failed to load url /node_modules/@slidev/client/constants (resolved id: /home/bram/src/cac-projects/slidev-test/node_modules/@slidev/client/constants) in /home/bram/src/cac-projects/slidev-test/node_modules/@slidev/client/App.vue. Does the file exist?
[vite:load-fallback] Could not load /home/bram/src/cac-projects/ee-project-overview-les-anciennes/node_modules/@slidev/client/constants (imported by node_modules/@slidev/client/App.vue?vue&type=script&setup=true&lang.ts): ENOENT: no such file or directory, open '/home/bram/src/cac-projects/ee-project-overview-les-anciennes/node_modules/@slidev/client/constants'
transforming (35) node_modules/@slidev/client/internals/Play.vue[Error: Could not load /home/bram/src/cac-projects/ee-project-overview-les-anciennes/node_modules/@slidev/client/constants (imported by node_modules/@slidev/client/App.vue?vue&type=script&setup=true&lang.ts): ENOENT: no such file or directory, open '/home/bram/src/cac-projects/ee-project-overview-les-anciennes/node_modules/@slidev/client/constants']

To Reproduce
Steps to reproduce the behavior:

  1. Run npm init slidev@latest
  2. Project name: slidev-test
  3. Install and start it now: yes
  4. Choose the agent: npm

Desktop (please complete the following information):

  • OS: Fedora 37
  • Browser: Chrome 112.0.5615.121
  • Slidev version: v0.40.13
@patrickdronk
Copy link

I have similar issues.

@KenN7
Copy link
Contributor

KenN7 commented Apr 20, 2023

same issue here

@0xR
Copy link

0xR commented Apr 20, 2023

Fixed it by running:
npm init slidev@0.29.2

no luck with:
0.39.0
0.40.12
0.40.13 (latest)

@tonai
Copy link
Contributor

tonai commented Apr 20, 2023

I have an "old" version that is working with slidev 0.40.5
If I remove package-lock and npm install then it's not working anymore.
It might be related to some dependencies and not related to slidev itself...

@antfu
Copy link
Member

antfu commented Apr 20, 2023

It seems to be caused by Vite 4.3 because of vitejs/vite#12450

Looking into it

@lihbr
Copy link

lihbr commented Apr 20, 2023

Temporary fix for users, you can explicitly declare Vite as a dependency of the project to force its resolution to an older version:

"devDependencies": {
	"vite": "2.2.2"
}

Edit: Just use the latest release for a real fix, ^0.40.14

@antfu antfu closed this as completed in 6305560 Apr 20, 2023
@antfu
Copy link
Member

antfu commented Apr 20, 2023

Fixed with ^0.40.14

@bram-pkg
Copy link
Contributor Author

Awesome, thank you for the quick action @antfu!

alpcoker pushed a commit to alpcoker/slidev that referenced this issue Jul 26, 2023
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

7 participants