Closed ealmansi closed 4 years ago
I'm getting
You must provide the URL of lib/mappings.wasm by calling SourceMapConsumer.initialize({ 'lib/mappings.wasm': ... }) before using SourceMapConsumer
at readWasm
With nodemon + unfetch + slonik
. Probably related to this issue.
I had a similar issue to @ivan-kleshnin when using Slonik with Next.js in my project:
https://github.com/karlhorky/next.js-with-slonik
Fixed it in this commit by switching isomorphic-unfetch
to cross-fetch
, like @gabiseabra in https://github.com/emcasa/react-starter/pull/12:
https://github.com/karlhorky/next.js-with-slonik/commit/a61f47949aa367020c1b0d2f6d657e63702cb6a4
Awesome, thanks @danieltodonnell!
I made a mistake and commented in the wrong issue :(
I meant to write "we will investigate" in the issue in faunadb that was affected by this issue.
Bug Report
Requiring
isomorphic-unfetch
in a project built with Webpack targeting node leads to broken code. The issue is due to wrong interoperation between cjs & esm byisomorphic-unfetch
.How to Reproduce
Expected Result
Actual Result
Context
In file
packages/isomorphic-unfetch/index.js
, you can find the following code:require('node-fetch')
. However, the packagenode-fetch
exposes the functionfetch
as the default export in an ESM module [1]. The correct way of requiring a default export from CommonJS isrequire('node-fetch').default
; see [2].[1] https://github.com/bitinn/node-fetch/blob/master/src/index.js#L34 [2] https://github.com/bitinn/node-fetch/issues/450#issuecomment-462695245
Environment