New module related issues when upgrading
See original GitHub issueDescription
Upgrading from @master-chief/alpaca ^3.6.3 → ^4.2.3
I’ve just begin to dig on these to… but in case they are some other quick ones. Both of these are new for me (the cdk synth one involves bundling with esbuild):
eikeon@iMac matic % npm run build
> matic@0.1.6 build /Users/eikeon/matic
> tsc
eikeon@iMac matic % npm run cdk synth
> matic@0.1.6 cdk /Users/eikeon/matic
> cdk "synth"
Bundling asset MaticPipeline/PreProd/Matic/handler/Code/Stage...
> ../node_modules/node-gyp-build/index.js: warning: Indirect calls to "require" will not be bundled (surround with a try/catch to silence this warning)
6 │ var runtimeRequire = typeof __webpack_require__ === 'function' ? __non_webpack_require__ : require // eslint-disable-line
╵ ~~~~~~~
1 warning
Successfully synthesized to /Users/eikeon/matic/cdk.out
Supply a stack id (MaticPipeline, MaticRepo) to display its template.
eikeon@iMac matic % node_modules/.bin/ts-node t.ts
Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /Users/eikeon/matic/node_modules/@master-chief/alpaca/dist/mjs/index.js
require() of ES modules is not supported.
require() of /Users/eikeon/matic/node_modules/@master-chief/alpaca/dist/mjs/index.js from /Users/eikeon/matic/lib/matic-stack-handler.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/eikeon/matic/node_modules/@master-chief/alpaca/package.json.
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1080:13)
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/eikeon/matic/lib/matic-stack-handler.ts:2:1)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
eikeon@iMac matic %
Issue Analytics
- State:
- Created 3 years ago
- Comments:20 (4 by maintainers)
Top Results From Across the Web
Upgrading a module with a newly added dependencies ...
When a module is upgraded, but it has a new dependency from the older version, Drupal does not check for this, and things...
Read more >The Drupal 9 upgrade Config Split issue and how to fix it - Inviqa
In this article we look back at an issue we've encountered with Drupal Config Split when upgrading Drupal 8 to 9 – and...
Read more >Version number errors when installing a new module in ...
To fix this error, use the following steps to check for issues with module dependency, and resolve those issues by updating your modules....
Read more >Upgrading Modules Using Gogo Shell - Learn — Liferay
Here are the module upgrade topics: Gogo Shell Command Usage. Listing Modules Ready for Upgrades. Troubleshooting Module Dependencies. Executing Module Upgrades.
Read more >Upgrading to Drupal 9: The Complete Plan | Vardot Blog
If any module has a compatibility issue, create a ticket for it in your ticketing system and insert detailed info about it. That...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I experienced the issue he was facing when trying to use the same compiler. Without taking extra steps new users of
ts-node
will hit the same wall. While there is a way around it, its actually more complicated than just addingcjs
compilation for legacy support on our end. The JS community really hasn’t progressed enough to ditch it entirely IMO.@eikeon since node 14 (current LTE) supports es modules, there was no much point to cling to commonjs. Besides, that allowed us to properly support browsers and other combinations: Cuurently these bundles are provided: