Skip to content

[2.0] Svelte-kit prerender issue: ReferenceError: require is not defined in ES module scope, you can use import instead #23

@gyurielf

Description

@gyurielf

Hello there!

First of all, thanks for the new version!

I got this message when I try to build (prerender) my app with adapter-static, with the 2.0 version.
ReferenceError: require is not defined in ES module scope, you can use import instead.

I guess the problem somewhere around createEncryptedStorage, based on the logs.

 const [i2, o2, s2] = await Promise.all([n3.hexToBuffer(r3[0]), n3.hexToBuffer(e3[0]), n3.hexToBuffer(e3[1])]), a2 = await n3.decipher(t3, i2, s2, o2); return await n3.bufferToString(a2); } }; if ("undefined" == typeof window) { const e3 = require("util"), r3 = require("crypto"), t3 = e3.promisify(r3.pbkdf2), i2 = e3.promisify(r3.randomBytes); n2.normalizeHash = function(e4) { return e4.replace("-", "").toLowerCase(); }, n2.normalizeAlgorithm = function(e4) { return 0 !== e4.toLowerCase().indexOf("aes") ? e4 : e4.toLowerCase(); ... 

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions