Closed Geal closed 1 year ago
Seems to be related to https://github.com/rollup/plugins/issues/617
I tried to --target web
when building the wasm package and the generated code is back, but It now throws this error:
❯ rollup -c
index.js → ./rollup-dist...
[!] Error: Identifier 'init' has already been declared
../biscuit-wasm/module/biscuit.js (2190:15)
2188: }
2189:
2190: async function init(input) {
^
2191: if (typeof input === 'undefined') {
2192: input = new URL('biscuit_bg.wasm', import.meta.url);
Error: Identifier 'init' has already been declared
at error (/home/ptondereau/Code/rust/biscuit-js-example/node_modules/rollup/dist/shared/rollup.js:198:30)
at Module.error (/home/ptondereau/Code/rust/biscuit-js-example/node_modules/rollup/dist/shared/rollup.js:12560:16)
at Module.tryParse (/home/ptondereau/Code/rust/biscuit-js-example/node_modules/rollup/dist/shared/rollup.js:12937:25)
at Module.setSource (/home/ptondereau/Code/rust/biscuit-js-example/node_modules/rollup/dist/shared/rollup.js:12842:24)
at ModuleLoader.addModuleSource (/home/ptondereau/Code/rust/biscuit-js-example/node_modules/rollup/dist/shared/rollup.js:22090:20)
fixed in 895c4ede8082356cc0875249888a125a8106b6da
I have tried for a while to get it to work with rollup and still get some issues. Here's the current code I have:
It returns a bunch of errors of this kind and generates a bundled file full of
undefined
placeholders:What's weird here is that we have a working rollup config for the website, but maybe that one works because the package is built differently?