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

0.5.2 breaks in webpack #216

Closed
dstaver opened this issue Oct 12, 2023 · 2 comments · Fixed by #217
Closed

0.5.2 breaks in webpack #216

dstaver opened this issue Oct 12, 2023 · 2 comments · Fixed by #217

Comments

@dstaver
Copy link

dstaver commented Oct 12, 2023

0.5.1 works fine.

After upgrading to 0.5.2 webpack fails to build with these errors:

Module not found: Error: Can't resolve './create-query-service' in '/Users/daniel/project/node_modules/@connectrpc/connect-query/dist/esm'
Did you mean 'create-query-service.js'?
BREAKING CHANGE: The request './create-query-service' 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.

ERROR in ../../node_modules/@connectrpc/connect-query/dist/esm/index.js 15:0-105
Module not found: Error: Can't resolve './create-query-functions' in '/Users/daniel/project/node_modules/@connectrpc/connect-query/dist/esm'
Did you mean 'create-query-functions.js'?
BREAKING CHANGE: The request './create-query-functions' 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.

ERROR in ../../node_modules/@connectrpc/connect-query/dist/esm/index.js 16:0-64
Module not found: Error: Can't resolve './create-unary-functions' in '/Users/daniel/project/node_modules/@connectrpc/connect-query/dist/esm'
Did you mean 'create-unary-functions.js'?
BREAKING CHANGE: The request './create-unary-functions' 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.

ERROR in ../../node_modules/@connectrpc/connect-query/dist/esm/index.js 17:0-39
Module not found: Error: Can't resolve './utils' in '/Users/daniel/project/node_modules/@connectrpc/connect-query/dist/esm'
Did you mean 'utils.js'?
BREAKING CHANGE: The request './utils' 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.

ERROR in ../../node_modules/@connectrpc/connect-query/dist/esm/index.js 18:0-66
Module not found: Error: Can't resolve './use-transport' in '/Users/daniel/project/node_modules/@connectrpc/connect-query/dist/esm'
Did you mean 'use-transport.js'?
BREAKING CHANGE: The request './use-transport' 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.

ERROR in ../../node_modules/@connectrpc/connect-query/dist/esm/index.js 19:0-56
Module not found: Error: Can't resolve './create-unary-hooks' in '/Users/daniel/project/node_modules/@connectrpc/connect-query/dist/esm'
Did you mean 'create-unary-hooks.js'?
BREAKING CHANGE: The request './create-unary-hooks' 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.

webpack 5.88.2 compiled with 20 errors in 19953 ms

Manually editing node_modules/@connectrpc/connect-query/package.json and removing "type"="module" solves the issue

the client is generated with target=ts and then built to an internal module with typescript as a dual ESM/CJS package

I'm pinning the version to 0.5.1 for now

@paul-sachs
Copy link
Collaborator

Hi @dstaver, I'm sorry you ran into this problem. We've investigated moving to Node16 module resolution to catch these problems but ran into some downstream dependency problems. In the meantime, I have a fix for this specific problem and will get that released soon.

paul-sachs added a commit that referenced this issue Oct 12, 2023
Due to changes made in #180, exports were referenced as `.js` files,
which means that all files must subsequently imported with the `.js`
full extension because we are declared as `type: module`.

The javascript module system just keeps on giving.

Fixes #216
@paul-sachs
Copy link
Collaborator

🚀 Released in 0.5.3

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

Successfully merging a pull request may close this issue.

2 participants