You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using this library with Next.js to perform biscuit checks within a website, but I'm having difficulties due to the contents of the snippets folder in the distributed module not being successfully traced by Next.js.
e.g. /@biscuit-auth/biscuit-wasm/module/snippets/biscuit-auth-1c48f52e9814dd36/inline0.js
In other words, when I build my website and run it, I receive errors because those files are missing. Next.js doesn't realise correctly notice that the files are necessary during its build process and excludes them from the bundle. I have a workaround where I copy them after bundling as part of the build script, but it's less than optimal to have to do this.
This folder seems to include three separate copies of the performance.js file from the source code. From my understanding, you are able to call performance.now() within the rust wasm code, and this file helps in some way with this. I guess the import tracer is missing this import because it's being done implicitly within wasm somehow.
I recognise that this issue could be a flaw in the Next.js tracing process, but I just wanted to understand why there are three copies of this file in the distributed package files, and why their contents can't be inlined into some other file.
I'm happy to have a go at creating a pr that addresses this issue, but I'd need to understand better how this file is being imported/used in the first place.
The text was updated successfully, but these errors were encountered:
louisjmorgan
changed the title
Question about bundling
Import tracing of performance.js file contents
Feb 8, 2024
I'm using this library with Next.js to perform biscuit checks within a website, but I'm having difficulties due to the contents of the
snippets
folder in the distributed module not being successfully traced by Next.js.e.g.
/@biscuit-auth/biscuit-wasm/module/snippets/biscuit-auth-1c48f52e9814dd36/inline0.js
In other words, when I build my website and run it, I receive errors because those files are missing. Next.js doesn't realise correctly notice that the files are necessary during its build process and excludes them from the bundle. I have a workaround where I copy them after bundling as part of the build script, but it's less than optimal to have to do this.
This folder seems to include three separate copies of the
performance.js
file from the source code. From my understanding, you are able to callperformance.now()
within the rust wasm code, and this file helps in some way with this. I guess the import tracer is missing this import because it's being done implicitly within wasm somehow.I recognise that this issue could be a flaw in the Next.js tracing process, but I just wanted to understand why there are three copies of this file in the distributed package files, and why their contents can't be inlined into some other file.
I'm happy to have a go at creating a pr that addresses this issue, but I'd need to understand better how this file is being imported/used in the first place.
The text was updated successfully, but these errors were encountered: