You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As reported in Discord, a user was trying to use the signals-utils package and was getting this error in the browser
import{SignalObject}from'signal-utils/object';
With this as the generated import map entries, where we can see the wildcards are not getting "expanded"
it recommends signal-utils but some of the imports from that npm, such as import { SignalObject } from 'signal-utils/object'; hit more odd import map behaviors. but if I just define single signals for each property instead of a reactive object, I can import it as import * as stores from ...then itsstores..get()and .set()` which is close enough.
Somewhat related, but one of the issues this package possibly introduces is that the when we try to map ./* we are getting extensions on the left hand side, although the usage details don't assume that, e.g.
Interestingly, Node seems to detect this just fine? If adding .ts.js we get an SSR error 🤔
node:internal/process/promises:394
triggerUncaughtException(err, true /* fromPromise */);
^
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/Users/owenbuckley/Workspace/github/greenwood-lit-ssr/node_modules/signal-utils/dist/object.ts.js.ts.js' imported from /Users/owenbuckley/Workspace/github/greenwood-lit-ssr/src/components/card.ts
at finalizeResolution (node:internal/modules/esm/resolve:275:11)
at moduleResolve (node:internal/modules/esm/resolve:932:10)
at defaultResolve (node:internal/modules/esm/resolve:1056:11)
at nextResolve (node:internal/modules/esm/hooks:748:28)
at resolve (file:///Users/owenbuckley/Workspace/github/greenwood-lit-ssr/node_modules/.pnpm/@[email protected]_patch_hash=apevrozsvdlx72kzhcuzdsx7pm/node_modules/@greenwood/cli/src/loader.js:91:10)
at nextResolve (node:internal/modules/esm/hooks:748:28)
at Hooks.resolve (node:internal/modules/esm/hooks:240:30)
at handleMessage (node:internal/modules/esm/worker:199:24)
at Immediate.checkForMessages (node:internal/modules/esm/worker:141:28)
at process.processImmediate (node:internal/timers:491:21) {
code: 'ERR_MODULE_NOT_FOUND',
url: 'file:///Users/owenbuckley/Workspace/github/greenwood-lit-ssr/node_modules/signal-utils/dist/object.ts.js.ts.js'
}
The text was updated successfully, but these errors were encountered:
thescientist13
changed the title
export maps sub condition object key with a wildcard are not resolving in the browser
export maps sub condition object keys with a wildcard are not resolving in the browser (condition not getting expanded)
Jan 25, 2025
thescientist13
changed the title
export maps sub condition object keys with a wildcard are not resolving in the browser (condition not getting expanded)
export map sub condition object keys with a wildcard are not resolving in the browser (condition not getting expanded)
Jan 25, 2025
Type of Change
Bug
Summary
As reported in Discord, a user was trying to use the signals-utils package and was getting this error in the browser
With this as the generated import map entries, where we can see the wildcards are not getting "expanded"
Details
Looking into a bit further, it seems to be an oversight in our export conditions logic where-in with an export map like so
https://unpkg.com/browse/[email protected]/package.json
We are missing tracking for wildcards
https://github.com/ProjectEvergreen/greenwood/blob/v0.31.0-alpha.5/packages/cli/src/lib/walker-package-ranger.js#L182
Which we do with non-object conditions
https://github.com/ProjectEvergreen/greenwood/blob/v0.31.0-alpha.5/packages/cli/src/lib/walker-package-ranger.js#L196
Somewhat related, but one of the issues this package possibly introduces is that the when we try to map
./*
we are getting extensions on the left hand side, although the usage details don't assume that, e.g.Interestingly, Node seems to detect this just fine? If adding .ts.js we get an SSR error 🤔
The text was updated successfully, but these errors were encountered: