You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@age.apache.org by GitBox <gi...@apache.org> on 2022/11/24 11:04:37 UTC

[GitHub] [age-viewer] lukehinds opened a new issue, #70: Must use import to load ES Module

lukehinds opened a new issue, #70:
URL: https://github.com/apache/age-viewer/issues/70

   **Describe the bug**
   
   When running `npm run start` I get the following stack trace error
   
   ```
   > ag-viewer-backend@0.4.0 start /Users/lhinds/age-viewer-1.0.0-rc2/backend
   > babel-node src/bin/www
   
   internal/modules/cjs/loader.js:1080
         throw new ERR_REQUIRE_ESM(filename, parentPath, packageJsonPath);
         ^
   
   Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /Users/lhinds/age-viewer-1.0.0-rc2/backend/node_modules/antlr4/src/antlr4/index.js
   require() of ES modules is not supported.
   require() of /Users/lhinds/age-viewer-1.0.0-rc2/backend/node_modules/antlr4/src/antlr4/index.js from /Users/lhinds/age-viewer-1.0.0-rc2/backend/src/tools/AGEParser.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
   Instead rename index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /Users/lhinds/age-viewer-1.0.0-rc2/backend/node_modules/antlr4/package.json.
   
       at Module._extensions..js (internal/modules/cjs/loader.js:1080:13)
       at Object.newLoader [as .js] (/Users/lhinds/age-viewer-1.0.0-rc2/backend/node_modules/pirates/lib/index.js:141:7)
       at Module.load (internal/modules/cjs/loader.js:928:32)
       at Function.Module._load (internal/modules/cjs/loader.js:769:14)
       at Module.require (internal/modules/cjs/loader.js:952:19)
       at require (internal/modules/cjs/helpers.js:88:18)
       at Object.<anonymous> (/Users/lhinds/age-viewer-1.0.0-rc2/backend/src/tools/AGEParser.js:20:1)
       at Module._compile (internal/modules/cjs/loader.js:1063:30)
       at Module._compile (/Users/lhinds/age-viewer-1.0.0-rc2/backend/node_modules/pirates/lib/index.js:136:24)
       at Module._extensions..js (internal/modules/cjs/loader.js:1092:10) {
     code: 'ERR_REQUIRE_ESM'
   }
   ```
   
   ```
   ProductName:		macOS
   ProductVersion:		13.0.1
   BuildVersion:		22A400
   ```
   
   ```
   node --version
   v14.16.0
   ```
   
   Log file attached
   
   [Archive.zip](https://github.com/apache/age-viewer/files/10083842/Archive.zip)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [age-viewer] MJinH commented on issue #70: Must use import to load ES Module

Posted by GitBox <gi...@apache.org>.
MJinH commented on issue #70:
URL: https://github.com/apache/age-viewer/issues/70#issuecomment-1328277536

   This might have to do with the version of node. I had the same error and resolved by updating to the latest LTS version. My current version is v16.17.0.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [age-viewer] lukehinds commented on issue #70: Must use import to load ES Module

Posted by GitBox <gi...@apache.org>.
lukehinds commented on issue #70:
URL: https://github.com/apache/age-viewer/issues/70#issuecomment-1345942494

   latest branch fixed it thanks!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [age-viewer] lukehinds commented on issue #70: Must use import to load ES Module

Posted by GitBox <gi...@apache.org>.
lukehinds commented on issue #70:
URL: https://github.com/apache/age-viewer/issues/70#issuecomment-1328806416

   unfortunately it still blows up for me on the v16 release
   
   <img width="1919" alt="image" src="https://user-images.githubusercontent.com/7058938/204248074-d87810b2-8aea-49cf-8335-7d5f56256553.png">
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [age-viewer] lukehinds closed issue #70: Must use import to load ES Module

Posted by GitBox <gi...@apache.org>.
lukehinds closed issue #70: Must use import to load ES Module
URL: https://github.com/apache/age-viewer/issues/70


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [age-viewer] marodins commented on issue #70: Must use import to load ES Module

Posted by GitBox <gi...@apache.org>.
marodins commented on issue #70:
URL: https://github.com/apache/age-viewer/issues/70#issuecomment-1329805775

   Please use the latest code by cloning the current repo and checkout main branch. Then run the application.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [age-viewer] Nimra-1234 commented on issue #70: Must use import to load ES Module

Posted by GitBox <gi...@apache.org>.
Nimra-1234 commented on issue #70:
URL: https://github.com/apache/age-viewer/issues/70#issuecomment-1345508011

   Try to clone main branch with "node version 14.16.0". This will surely work.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org