NPM dependency shims no longer work on Firefox 102.1?
JordanMartinez opened this issue · 4 comments
JordanMartinez commented
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 commented
pete-murphy commented
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
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 commented
Thanks!
Yeah, the ReferenceError: main is not defined was fixed in #288.
JordanMartinez commented
Looks like updating es-module-shims to 1.5.9 fixes the issue.

