Open alcferreira opened 2 years ago
I have the same issue
@walletconnect.jsonrpc-utils.v1.0.0.js:3 Uncaught (in promise) SyntaxError: The requested module '/_snowpack/pkg/@walletconnect.environment.v1.0.0.js' does not provide an export named 'formatErrorMessage' (at @walletconnect.jsonrpc-utils.v1.0.0.js:3:10)
add namedExports doesn't help
@crapthings Is this the same bug?
It seems like a bug in snowpack but I'm not sure it's related to the namedExports
thing.
If you have a look at the @walletconnect/jsonrpc-utils
package snowpack seems to mistakenly be thinking that all it's exports are being re-exported from @walletconnect/environment
.
I think this is related to a nested re-export statement.
If you have a look here: https://unpkg.com/@walletconnect/jsonrpc-utils@1.0.0/dist/esm/index.js
The first 2 lines work fine. All the exports from ./constants
and ./error
are re-exported correctly, with parseConnectionError
being the last export in the snowpack'ed version. After that ./env
uses the line export * from "@walletconnect/environment";
and snowpack seems to convert that to
export { formatErrorMessage, formatJsonRpcError, formatJsonRpcRequest, formatJsonRpcResult, isHttpUrl, isJsonRpcError, isJsonRpcPayload, isJsonRpcRequest, isJsonRpcResponse, isJsonRpcResult, isJsonRpcValidationInvalid, isLocalhostUrl, isValidDefaultRoute, isValidLeadingWildcardRoute, isValidRoute, isValidTrailingWildcardRoute, isValidWildcardRoute, isWsUrl, payloadId } from '@walletconnect/environment';
simply assuming the rest of the exports are coming from @walletconnect/environment
.
Not sure if this should be moved to a different issue.
Quick checklist
What package manager are you using?
yarn
What operating system are you using?
macOS
Describe the bug
I'm updating snowpack from version 2.18.2 to 3.8.8.
I fixed the breaking changes related to config name changes that we were expecting based on the upgrade guide, but after we keep getting this error message:
Module "XXXX" has no exported member "default". Did you mean to use "import default from 'XXXX'" instead?
.On version 2.x this was fixed by using the
namedExports
option that is documented on the Common error detailsI didn't find anything else related to this on the docs, did I miss something? Was there any other change on this behavior that perhaps was not documented?
Steps to reproduce
namedImports
and snowpack@2.xnamedImports
config won't work anymoreLink to minimal reproducible example (optional)
No response