connectrpc / connect-query-es

TypeScript-first expansion pack for TanStack Query that gives you Protobuf superpowers.

Home Page:https://connectrpc.com/docs/web/query/getting-started

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

0.5.2 breaks in webpack

dstaver opened this issue · comments

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

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.

🚀 Released in 0.5.3