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

Cannot bundle with webpack #555

Closed
Jack-Works opened this issue Feb 14, 2022 · 3 comments · Fixed by #562
Closed

Cannot bundle with webpack #555

Jack-Works opened this issue Feb 14, 2022 · 3 comments · Fixed by #562

Comments

@Jack-Works
Copy link

npm i @ethersphere/bee-js webpack webpack-cli

src/index.js

import { Bee } from '@ethersphere/bee-js'
console.log(Bee)

And run npx webpack, it reports:

WARNING in ./src/index.js 2:12-15
export 'Bee' (imported as 'Bee') was not found in '@ethersphere/bee-js' (module has no exports)

ERROR in ./node_modules/.pnpm/@ethersphere+bee-js@3.3.0/node_modules/@ethersphere/bee-js/dist/mjs/index.js 1:0-28
Module not found: Error: Can't resolve './bee' in 'C:\Users\Jack\Workspace\bee\node_modules\.pnpm\@ethersphere+bee-js@3.3.0\node_modules\@ethersphere\bee-js\dist\mjs'
Did you mean 'bee.js'?
BREAKING CHANGE: The request './bee' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.
 @ ./src/index.js 1:0-41 2:12-15

It looks like this package ships an invalid ESM bundle. (Node ESM requires a fully specified extension name).

@AuHau
Copy link
Contributor

AuHau commented Feb 14, 2022

Interesting! We are aware of several issues with the last release and there will be a patch release soon, but I was not aware of this problem. Thanks!

I assume there is no specific webpack configuration?

@Jack-Works
Copy link
Author

I assume there is no specific webpack configuration?

Yes. It failing with default webpack 5 config

@AuHau
Copy link
Contributor

AuHau commented Feb 16, 2022

This should be fixed with the lastest 3.3.1 release. Please let us known if the problem persists for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants