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

Issue importing lodash #1058

Open
HalfdanJ opened this issue Sep 22, 2022 · 3 comments
Open

Issue importing lodash #1058

HalfdanJ opened this issue Sep 22, 2022 · 3 comments

Comments

@HalfdanJ
Copy link

I'm trying to use miragejs, but getting blocked by a runtime syntax error.

The project is using @web/dev-server as dev server, with esbuild plugin, and is written in typescript.

When importing miragejs, i get a runtime error

Uncaught SyntaxError: The requested module './../../lodash.assign/index.js' does not provide an export named 'default' (at mirage-esm.js:20:8)

If I look at the code in mirage-esm, I see

...
import assign from './../../lodash.assign/index.js';
...

And if I look inside that file is see

...
module.exports = assign;

which to me seems not to be correct. Theres no default export, as the mirage code expects.

@HalfdanJ
Copy link
Author

Since mirage is written as an esm module, shouldn't it depend on lodash-es instead?

@JS-Coriander
Copy link

Hi, I got the same error, did you solve it?

@amekusa
Copy link

amekusa commented Jun 5, 2023

Maybe the same error I got, trying to bundle with rollup:

RollupError: "default" is not exported by "node_modules/lodash.uniq/index.js", imported by "node_modules/miragejs/dist/mirage-esm.js"
import { createServer, Model, Factory } from 'miragejs';

v0.1.47

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