-
-
Notifications
You must be signed in to change notification settings - Fork 140
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
Failed to import - @reduxjs/toolkit #681
Comments
Good catch! I was debugging esbuild itself and didn't consider that this error would be introduced by esm.sh . Replacing |
ideally you should use target |
@ije The issue is still present, see https://esm.sh/stable/preact@10.15.1/denonext/devtools.mjs where |
@marvinhagemeister not deploy the patch yet, will do it tmr and let you know, thanks |
This doesn't seem to be a "one size fits all" type of fix. In https://esm.sh/v128/@reduxjs/toolkit@1.9.5/denonext/toolkit.development.mjs the problematic line has changed from: var composeWithDevTools = typeof Deno !== "undefined" && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ? to var composeWithDevTools = typeof window !== "undefined" && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ in https://esm.sh/v129/@reduxjs/toolkit@1.9.5/denonext/toolkit.development.mjs. (Note the version numbers in the URLs are different.) So the fix deployed in v129 (7d63a99) which resolved this definitely did work. Great. But there was hope from the fresh community that this would also fix the preact debugging issue. But both of the following:
have this code: typeof Deno <"u"&&window.__PREACT_DEVTOOLS__ Should I log a separate issue for this? |
@deer can you please ask the fresh community update to v129+? |
Sorry, I think I wasn't clear with my comment. I don't think this has anything in particular to do with fresh. I'll try to explain better a second time: The preact source has a line like this: if (typeof window != 'undefined' && window.__PREACT_DEVTOOLS__) { and both esm.sh v128 and esm.sh v129 produce something like this: typeof Deno <"u"&&window.__PREACT_DEVTOOLS__ Contrast this with the redux toolkit source which has a line like: typeof window !== 'undefined' &&
(window as any).__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ esm.sh v128 has it like: typeof Deno !== "undefined" && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ but esm.sh v129 has it like: typeof window !== "undefined" && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ The hope was that this would get resolved for the preact devtools, but it seems like we're still getting |
I notice that adding |
The preact devtools package seems to be a different bug(?). Should it be a different issue? The prior behavior for reduxjs/toolkit could be bypassed by giving an explicit target, but that does not work in this case:
|
Failing module
Error message
After running
deno run
I got this:ReferenceError: window is not defined
It seems like it's because of the following line here:
https://esm.sh/v97/@reduxjs/toolkit@1.9.5/denonext/toolkit.development.mjs:180:60
It's checking for Deno to not be undefined, but then immediately accessing
window
, hence triggering the ReferenceErrorAdditional info
The text was updated successfully, but these errors were encountered: