Describe the bug
polyFill function is not exported from Typed.js, but called at the top-level of Typed.js itself. This seems to cause issues with bundling, where the definition isn't picked up by the bundle, causing the top-level polyFill() call to report Uncaught ReferenceError: polyFill is not defined.
To Reproduce
Initialize a spago project via spago init. Add the following list of dependencies to spago.dhall:
[ "arraybuffer"
, "arraybuffer-types"
, "console"
, "effect"
, "prelude"
, "psci-support"
]
Modify src/Main.purs to be as follows:
-- src/Main.purs
module Main where
import Prelude
import Data.ArrayBuffer.Types (ArrayView, Int32)
import Data.ArrayBuffer.Typed as ArrayBuffer
import Effect (Effect)
import Effect.Console (log)
main :: Effect Unit
main = do
_ :: ArrayView Int32 <- ArrayBuffer.empty 0
log "hello"
Bundle it and run it via node:
$ spago bundle-app
$ node index.js
Expected behavior
See the output: "hello".
Actual behavior
<path-to-project>\index.js:6
polyFill();
^
ReferenceError: polyFill is not defined
Additional context
Running the bundle through browser or node does not make a difference, failing in both cases.
Describe the bug
polyFillfunction is not exported fromTyped.js, but called at the top-level ofTyped.jsitself. This seems to cause issues with bundling, where the definition isn't picked up by the bundle, causing the top-levelpolyFill()call to reportUncaught ReferenceError: polyFill is not defined.To Reproduce
Initialize a spago project via
spago init. Add the following list of dependencies tospago.dhall:Modify
src/Main.pursto be as follows:Bundle it and run it via
node:Expected behavior
See the output:
"hello".Actual behavior
Additional context
Running the bundle through browser or node does not make a difference, failing in both cases.