Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import tracing of performance.js file contents #46

Open
louisjmorgan opened this issue Feb 8, 2024 · 0 comments
Open

Import tracing of performance.js file contents #46

louisjmorgan opened this issue Feb 8, 2024 · 0 comments

Comments

@louisjmorgan
Copy link

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.

@louisjmorgan louisjmorgan changed the title Question about bundling Import tracing of performance.js file contents Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant