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
There it is said: "To import an ESM file, you'll need to reference your script by an absolute path and ensure you have a package.json file with "type": "module" specified."
-> How should I have an absolute path to this package as I want to directly have it used without copying the package to my repo manually or so.
-> How can I achieve the changing of the package.json file? It is not good documentated how to find this and where to change it.
If possible, please just change the main.yml to a version how it will work, would be great!
Error information:
That's the error I got if I use the line:
const rdf = require('rdf-ext');
->
Error [ERR_REQUIRE_ESM]: require() of ES Module /home/runner/work/test-rdf-ext/test-rdf-ext/node_modules/rdf-ext/index.js from /home/runner/work/_actions/actions/github-script/v6/dist/index.js not supported.
13Instead change the require of /home/runner/work/test-rdf-ext/test-rdf-ext/node_modules/rdf-ext/index.js in /home/runner/work/_actions/actions/github-script/v6/dist/index.js to a dynamic import() which is available in all CommonJS modules.
And if I update the line to the import line:
const rdf = import('rdf-ext');
That's the error I got if I use the line ->
Error: Unhandled error: SyntaxError: Cannot use import statement outside a module
Expected behavior
Sucessful import of rdf-ext package
Thanks a lot and Cheers from Hamburg!
The text was updated successfully, but these errors were encountered:
jannikreisberg
changed the title
Problems with EM Import of "rdf-ext"
Problems with ESM Import of "rdf-ext"
Mar 15, 2022
jannikreisberg
changed the title
Problems with ESM Import of "rdf-ext"
Problems with ESM Import of "rdf-ext" in Github Action
Mar 16, 2022
Describe the bug
It is not possible to import an npm package via ESM (package: rdf-ext).
I want to import the npm package rdf-ext, but as it is a ESM, I can not import it with require()
Therefore I need to use the import function, see here your documentation:
https://github.com/actions/github-script#use-esm-import
There it is said:
"To import an ESM file, you'll need to reference your script by an absolute path and ensure you have a package.json file with "type": "module" specified."
-> How should I have an absolute path to this package as I want to directly have it used without copying the package to my repo manually or so.
-> How can I achieve the changing of the package.json file? It is not good documentated how to find this and where to change it.
Look for my example repo: https://github.com/jannikreisberg/test-rdf-ext/blob/main/.github/workflows/main.yml
If possible, please just change the main.yml to a version how it will work, would be great!
Error information:
That's the error I got if I use the line:
->
And if I update the line to the import line:
That's the error I got if I use the line ->
Expected behavior
Sucessful import of rdf-ext package
Thanks a lot and Cheers from Hamburg!
The text was updated successfully, but these errors were encountered: