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 Goja as the JavaScript runtime and it doesn't support ES modules. When I try to use this library with moduleResolution: "node" and module: "commonjs" it gives the following error:
Cannot find module '@grafana/grafana-foundation-sdk/timeseries' or its corresponding type declarations.
There are types at '.../node_modules/@grafana/grafana-foundation-sdk/dist/timeseries/index.d.ts', but this result could not be resolved under your current 'moduleResolution' setting. Consider updating to 'node16', 'nodenext', or 'bundler'.
What would you like to be added?
CommonJS support for module resolution.
The text was updated successfully, but these errors were encountered:
I noticed that there is a pull request to implement module support in Goja, but it appears to be delayed due to time constraints on the maintainer's side. Grafana has forked Goja into Sobek and has merged the module support there. Perhaps migrating to Sobek could help resolve your issue?
Sobek maintainers doesn't have a short term plan to make ES modules integration easier: grafana/sobek#49 (comment)
While in the future we might make a project simialr to goja_nodejs, the current purpose of Sobek is to compliment k6 development.
I would like to pull out some code from k6 and make it generally available for Sobek users to just use it, but this is unfortunately not in the current priority list and likely will require some changes. Some of those changes are already kind of underway for different reasons, so 🤷
Why is this needed?
I'm using Goja as the JavaScript runtime and it doesn't support ES modules. When I try to use this library with
moduleResolution: "node"
andmodule: "commonjs"
it gives the following error:What would you like to be added?
CommonJS support for module resolution.
The text was updated successfully, but these errors were encountered: