-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
Issue with miragejs #240
Comments
As a clarification, importing the server works fine alone. Only when trying to instantiate it, the error emerges. |
I just tested locally and it works. It was likely a resolver issue which happens to also be fixed in the last few commits (which refactored the resolver quite a bit). |
Upgraded vite to Anyways, got the same code working with vue-cli project so I'm continuing with that now. I can test this out later when the project matures a bit :) |
Hmm, it's definitely working for me on a fresh install. Can you provide a reproduction? (Just want to make sure where the problem is) |
Sure, here's a cleaned down fresh repro: https://github.com/Uninen/vite-miragejs-issue-240 Uncomment line 6 in Edit: my original repo has much more going on and the miragejs import and server were in a different file, but it seems to trigger for me with this very bare-bones setup as well. I tried to take out everything non-related while still keeping some functionality to verify that Vue and Vite work normally. |
Cleaned up the repo a bit more and tested again with the latest vite v0.16.11, can still reproduce on my machine. Edit: just noticed that there was new messages in the terminal (lodash is not in the pacage.json but I assume miragejs is using it):
|
Ok this is because you put |
Oh, okay! Thanks 👍 |
Describe the bug
I built an app with vite and TypeScript that uses network and works fine without any problems. After trying to add miragejs server, the dev server fails. Not sure if the problem is with vite, my configuration or miragejs. Based on the logs, some lodash imports by miragejs are missing. (Not using lodash myself.) Don't have any additional vite configuration set up.
Adding:
results in following error and console message:
SyntaxError: import not found: default mirage-esm.js:14:7
System Info
vite
version: 0.16.7Logs (Optional if provided reproduction)
vite
orvite build
with the--debug
flag.The text was updated successfully, but these errors were encountered: