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

NPM dependency shims no longer work on Firefox 102.1? #289

Closed
JordanMartinez opened this issue Jul 16, 2022 · 4 comments · Fixed by #290
Closed

NPM dependency shims no longer work on Firefox 102.1? #289

JordanMartinez opened this issue Jul 16, 2022 · 4 comments · Fixed by #290

Comments

@JordanMartinez
Copy link
Contributor

I think Firefox made a few changes recently (not exactly sure what) that breaks es-module-shims. Running the below code on https://try.purescript.org doesn't work for Firefox 102.1 but does on Chromium 103.0.5060.53. Can anyone else confirm?

module Main where

import Prelude

import Data.Foldable (fold)
import Effect (Effect)
import Effect.Console (log)
import TryPureScript as TP
import Data.Decimal as D

main :: Effect Unit
main = TP.render =<< TP.withConsole do
  log $ show $ D.fromString "132.4242"
@JordanMartinez
Copy link
Contributor Author

The error I see in the console is:
2022-07-16_10-56

@pete-murphy
Copy link
Contributor

Yeah, I get the following errors (on Firefox Dev Edition 100.0b9) with that snippet

Uncaught ReferenceError: main is not defined
    <anonymous> https://try.purescript.org/js/index.js:61
index.js:61:1
asm.js type error: Asm.js optimizer disabled because debugger is active es-module-shims.js
Uncaught (in promise) DOMException: Permission denied to access property "document" on cross-origin object es-module-shims.js:1
Uncaught TypeError: Error resolving module specifier “decimal.js”. Relative module specifiers must start with “./”, “../” or “/”. foreign.js:1:20

image

On Chrome 102.0.5005.115 I do see the (Just (fromString "132.4242")) rendered, and the

Uncaught ReferenceError: main is not defined
    at index.js:61:1

error in console.

@JordanMartinez
Copy link
Contributor Author

Thanks!

Yeah, the ReferenceError: main is not defined was fixed in #288.

@JordanMartinez
Copy link
Contributor Author

Looks like updating es-module-shims to 1.5.9 fixes the issue.

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