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

Add the @babel/plugin-syntax-import-attributes plugin to allow JSON imports with type assertion #251

Closed
BinToss opened this issue May 8, 2024 · 11 comments

Comments

@BinToss
Copy link

BinToss commented May 8, 2024

Babel throws when an import attribute such as import abc from "./abc.json" with { type: "json" } or await import("./abc.json", { assert: { type: "json" } }) is present in a source file; it suggests using @babel/plugin-syntax-import-attributes to resolve the issue.

note: to enable parsing the deprecated import abc from "./abs.json" assert { type: "json" } syntax, the plugin's deprecatedAssertSyntax option must be true (default: false).

@BinToss
Copy link
Author

BinToss commented May 24, 2024

So, I have bad news.
For some unknown reason, relying on packemon 4.1.0's @babel/plugin-syntax-import-attributes caused top-level awaits to be inserted into the CJS output which then causes rollup to throw an error.

This only happens after I upgrade from packemon 4.0.1 to 4.1.0, and remove @babel/plugin-syntax-import-attributes from my dev deps and config.

Leaving it in my dev-deps causes babel to load it twice and insert top-level awaits.

 hce.shared-config  npm i

> @halospv3/hce.shared-config@2.3.1 prepare

 ERROR 

 Duplicate plugin/preset detected.
 If you'd like to use two separate instances of a plugin,
 they need separate names, e.g.

   plugins: [
     ['some-plugin', {}],
     ['some-plugin', {}, 'some unique name'],
   ]

 Duplicates detected are:
 [
   {
     "alias": "C:\\Repos\\HaloSPV3\\hce.shared-config\\node_modules\\@babel\\plugin-syntax-import-attributes\\lib\\index.js",       
     "dirname": "C:\\Repos\\HaloSPV3\\hce.shared-config",
     "ownPass": false,
     "file": {
       "request": "C:\\Repos\\HaloSPV3\\hce.shared-config\\node_modules\\@babel\\plugin-syntax-import-attributes\\lib\\index.js",   
       "resolved": "C:\\Repos\\HaloSPV3\\hce.shared-config\\node_modules\\@babel\\plugin-syntax-import-attributes\\lib\\index.js"   
     }
   },
   {
     "alias": "C:\\Repos\\HaloSPV3\\hce.shared-config\\node_modules\\@babel\\plugin-syntax-import-attributes\\lib\\index.js",       
     "dirname": "C:\\Repos\\HaloSPV3\\hce.shared-config",
     "ownPass": false,
     "file": {
       "request": "@babel/plugin-syntax-import-attributes",
       "resolved": "C:\\Repos\\HaloSPV3\\hce.shared-config\\node_modules\\@babel\\plugin-syntax-import-attributes\\lib\\index.js"   
     }
   }
 ]

 STACK TRACE 

    at assertNoDuplicates (C:\Repos\HaloSPV3\hce.shared-config\node_modules\@babel\core\lib\config\config-descriptors.js:183:13)    
    at createDescriptors (C:\Repos\HaloSPV3\hce.shared-config\node_modules\@babel\core\lib\config\config-descriptors.js:107:3)      
    at createDescriptors.next (<anonymous>)
    at createPluginDescriptors (C:\Repos\HaloSPV3\hce.shared-config\node_modules\@babel\core\lib\config\config-descriptors.js:99:17)
    at createPluginDescriptors.next (<anonymous>)
    at C:\Repos\HaloSPV3\hce.shared-config\node_modules\@babel\core\lib\config\config-descriptors.js:65:32
    at Generator.next (<anonymous>)
    at Function.<anonymous> (C:\Repos\HaloSPV3\hce.shared-config\node_modules\@babel\core\lib\gensync-utils\async.js:21:3)
    at Generator.next (<anonymous>)
    at step (C:\Repos\HaloSPV3\hce.shared-config\node_modules\gensync\index.js:261:32)
    at evaluateAsync (C:\Repos\HaloSPV3\hce.shared-config\node_modules\gensync\index.js:291:5)
    at Function.errback (C:\Repos\HaloSPV3\hce.shared-config\node_modules\gensync\index.js:113:7)
    at errback (C:\Repos\HaloSPV3\hce.shared-config\node_modules\@babel\core\lib\gensync-utils\async.js:65:18)
    at async (C:\Repos\HaloSPV3\hce.shared-config\node_modules\gensync\index.js:188:17)
    at onFirstPause (C:\Repos\HaloSPV3\hce.shared-config\node_modules\gensync\index.js:216:13)
    at Generator.next (<anonymous>)
    at cachedFunction (C:\Repos\HaloSPV3\hce.shared-config\node_modules\@babel\core\lib\config\caching.js:52:46)
    at cachedFunction.next (<anonymous>)
    at mergeChainOpts (C:\Repos\HaloSPV3\hce.shared-config\node_modules\@babel\core\lib\config\config-chain.js:349:34)
    at mergeChainOpts.next (<anonymous>)
    at chainWalker (C:\Repos\HaloSPV3\hce.shared-config\node_modules\@babel\core\lib\config\config-chain.js:316:14)
    at chainWalker.next (<anonymous>)
    at buildRootChain (C:\Repos\HaloSPV3\hce.shared-config\node_modules\@babel\core\lib\config\config-chain.js:56:36)
    at buildRootChain.next (<anonymous>)
    at loadPrivatePartialConfig (C:\Repos\HaloSPV3\hce.shared-config\node_modules\@babel\core\lib\config\partial.js:72:62)
    at loadPrivatePartialConfig.next (<anonymous>)
    at loadPartialConfig (C:\Repos\HaloSPV3\hce.shared-config\node_modules\@babel\core\lib\config\partial.js:115:25)
    at loadPartialConfig.next (<anonymous>)
    at step (C:\Repos\HaloSPV3\hce.shared-config\node_modules\gensync\index.js:269:25)
    at evaluateAsync (C:\Repos\HaloSPV3\hce.shared-config\node_modules\gensync\index.js:291:5)

 ERROR 

 Module format "cjs" does not support top-level await. Use the "es" or "system" output formats rather.

 STACK TRACE 

Rollup    at getRollupError (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/parseAst.js:396:41)     
    at error (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/parseAst.js:392:42)
    at Module.render (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:14172:20)        
    at Chunk.renderModules (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:16734:41)  
    at Chunk.render (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:16230:111)        
    at file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:17907:72
    at Array.map (<anonymous>)
    at renderChunks (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:17907:53)
    at Bundle.generate (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:18145:19)      
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:20692:27
    at async catchUnfinishedHookActions
(file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:20119:16)
    at async file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/packemon/mjs/Artifact.mjs:98:128
    at async Promise.all (index 0)
    at async Artifact.buildCode (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/packemon/mjs/Artifact.mjs:89:5)
    at async Promise.all (index 0)
    at async Artifact.build (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/packemon/mjs/Artifact.mjs:59:5)

 ERROR 

 Module format "cjs" does not support top-level await. Use the "es" or "system" output formats rather.

 STACK TRACE 

Rollup    at getRollupError (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/parseAst.js:396:41)     
    at error (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/parseAst.js:392:42)
    at Module.render (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:14172:20)        
    at Chunk.renderModules (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:16734:41)  
    at Chunk.render (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:16230:111)        
    at file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:17907:72
    at Array.map (<anonymous>)
    at renderChunks (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:17907:53)
    at Bundle.generate (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:18145:19)      
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:20692:27
    at async catchUnfinishedHookActions
(file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:20119:16)
    at async file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/packemon/mjs/Artifact.mjs:98:128
    at async Promise.all (index 0)
    at async Artifact.buildCode (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/packemon/mjs/Artifact.mjs:89:5)
    at async Promise.all (index 0)
    at async Artifact.build (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/packemon/mjs/Artifact.mjs:59:5)

 ERROR 

 Module format "cjs" does not support top-level await. Use the "es" or "system" output formats rather.

 STACK TRACE 

Rollup    at getRollupError (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/parseAst.js:396:41)     
    at error (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/parseAst.js:392:42)
    at Module.render (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:14172:20)        
    at Chunk.renderModules (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:16734:41)  
    at Chunk.render (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:16230:111)        
    at file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:17907:72
    at Array.map (<anonymous>)
    at renderChunks (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:17907:53)
    at Bundle.generate (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:18145:19)      
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:20692:27
    at async catchUnfinishedHookActions
(file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:20119:16)
    at async file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/packemon/mjs/Artifact.mjs:98:128
    at async Promise.all (index 0)
    at async Artifact.buildCode (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/packemon/mjs/Artifact.mjs:89:5)
    at async Promise.all (index 0)
    at async Artifact.build (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/packemon/mjs/Artifact.mjs:59:5)
    at async file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/packemon/mjs/Package.mjs:48:9
    at async Promise.all (index 0)
    at async Package.build (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/packemon/mjs/Package.mjs:44:5)
    at async Packemon.build (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/packemon/mjs/Packemon.mjs:27:7)
    at async BuildCommand.build (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/packemon/mjs/commands/Build.mjs:24:5)     
    at async Program.runAndRender (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/@boost/cli/mjs/Program.mjs:464:24)      
    at async Program.run (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/@boost/cli/mjs/Program.mjs:288:18)
    at async Program.runAndExit (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/@boost/cli/mjs/Program.mjs:307:22)        
    at async run (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/packemon/mjs/bin.mjs:39:3)

While removing it from my dev deps also removes the duplicate plugins error, the top-level awaits are still inserted.

 hce.shared-config  npm i

> @halospv3/hce.shared-config@2.3.1 prepare

 ERROR 

 Module format "cjs" does not support top-level await. Use the "es" or "system" output formats rather.

 STACK TRACE 

Rollup    at getRollupError (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/parseAst.js:396:41)     
    at error (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/parseAst.js:392:42)
    at Module.render (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:14172:20)        
    at Chunk.renderModules (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:16734:41)  
    at Chunk.render (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:16230:111)        
    at file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:17907:72
    at Array.map (<anonymous>)
    at renderChunks (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:17907:53)
    at Bundle.generate (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:18145:19)      
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:20692:27
    at async catchUnfinishedHookActions
(file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:20119:16)
    at async file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/packemon/mjs/Artifact.mjs:98:128
    at async Promise.all (index 0)
    at async Artifact.buildCode (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/packemon/mjs/Artifact.mjs:89:5)
    at async Promise.all (index 0)
    at async Artifact.build (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/packemon/mjs/Artifact.mjs:59:5)

 ERROR 

 Module format "cjs" does not support top-level await. Use the "es" or "system" output formats rather.

 STACK TRACE 

Rollup    at getRollupError (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/parseAst.js:396:41)     
    at error (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/parseAst.js:392:42)
    at Module.render (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:14172:20)        
    at Chunk.renderModules (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:16734:41)  
    at Chunk.render (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:16230:111)        
    at file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:17907:72
    at Array.map (<anonymous>)
    at renderChunks (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:17907:53)
    at Bundle.generate (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:18145:19)      
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:20692:27
    at async catchUnfinishedHookActions
(file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:20119:16)
    at async file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/packemon/mjs/Artifact.mjs:98:128
    at async Promise.all (index 0)
    at async Artifact.buildCode (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/packemon/mjs/Artifact.mjs:89:5)
    at async Promise.all (index 0)
    at async Artifact.build (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/packemon/mjs/Artifact.mjs:59:5)

 ERROR 

 Module format "cjs" does not support top-level await. Use the "es" or "system" output formats rather.

 STACK TRACE 

Rollup    at getRollupError (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/parseAst.js:396:41)     
    at error (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/parseAst.js:392:42)
    at Module.render (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:14172:20)        
    at Chunk.renderModules (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:16734:41)  
    at Chunk.render (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:16230:111)        
    at file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:17907:72
    at Array.map (<anonymous>)
    at renderChunks (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:17907:53)
    at Bundle.generate (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:18145:19)      
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:20692:27
    at async catchUnfinishedHookActions
(file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:20119:16)
    at async file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/packemon/mjs/Artifact.mjs:98:128

 ERROR 

 Module format "cjs" does not support top-level await. Use the "es" or "system" output formats rather.

 STACK TRACE 

Rollup    at getRollupError (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/parseAst.js:396:41)     
    at error (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/parseAst.js:392:42)
    at Module.render (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:14172:20)        
    at Chunk.renderModules (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:16734:41)  
    at Chunk.render (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:16230:111)        
    at file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:17907:72
    at Array.map (<anonymous>)
    at renderChunks (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:17907:53)
    at Bundle.generate (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:18145:19)      
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:20692:27
    at async catchUnfinishedHookActions
(file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:20119:16)

 ERROR 

 Module format "cjs" does not support top-level await. Use the "es" or "system" output formats rather.

 STACK TRACE 

Rollup    at getRollupError (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/parseAst.js:396:41)     
    at error (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/parseAst.js:392:42)
    at Module.render (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:14172:20)        
    at Chunk.renderModules (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:16734:41)  
    at Chunk.render (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:16230:111)        
    at file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:17907:72
    at Array.map (<anonymous>)
    at renderChunks (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:17907:53)
    at Bundle.generate (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:18145:19)      
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:20692:27
    at async catchUnfinishedHookActions
(file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:20119:16)
    at async file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/packemon/mjs/Artifact.mjs:98:128
    at async Promise.all (index 0)
    at async Artifact.buildCode (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/packemon/mjs/Artifact.mjs:89:5)
    at async Promise.all (index 0)

 ERROR 

 Module format "cjs" does not support top-level await. Use the "es" or "system" output formats rather.

 STACK TRACE 

Rollup    at getRollupError (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/parseAst.js:396:41)     
    at error (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/parseAst.js:392:42)
    at Module.render (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:14172:20)        
    at Chunk.renderModules (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:16734:41)  
    at Chunk.render (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:16230:111)        
    at file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:17907:72
    at Array.map (<anonymous>)
    at renderChunks (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:17907:53)
    at Bundle.generate (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:18145:19)      
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:20692:27
    at async catchUnfinishedHookActions
(file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/rollup/dist/es/shared/node-entry.js:20119:16)
    at async file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/packemon/mjs/Artifact.mjs:98:128
    at async Promise.all (index 0)
    at async Artifact.buildCode (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/packemon/mjs/Artifact.mjs:89:5)
    at async Promise.all (index 0)
    at async Artifact.build (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/packemon/mjs/Artifact.mjs:59:5)
    at async file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/packemon/mjs/Package.mjs:48:9
    at async Promise.all (index 0)
    at async Package.build (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/packemon/mjs/Package.mjs:44:5)
    at async Packemon.build (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/packemon/mjs/Packemon.mjs:27:7)
    at async BuildCommand.build (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/packemon/mjs/commands/Build.mjs:24:5)     
    at async Program.runAndRender (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/@boost/cli/mjs/Program.mjs:464:24)      
    at async Program.run (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/@boost/cli/mjs/Program.mjs:288:18)
    at async Program.runAndExit (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/@boost/cli/mjs/Program.mjs:307:22)        
    at async run (file:///C:/Repos/HaloSPV3/hce.shared-config/node_modules/packemon/mjs/bin.mjs:39:3)

Only one source file was triggering all of these errors:

import jsonc from "eslint-plugin-jsonc";
import tseslint from "typescript-eslint";
import { type TSESLint } from "@typescript-eslint/utils";
import eslint from "@eslint/js";
import globals from "globals" with {type: "json"};

// https://eslint.org/docs/latest/use/configure/migration-guide#using-eslintrc-configs-in-flat-config
// https://www.google.com/search?q=javascript+recurse+through+object+and+remove+undefined+properties

const globalIgnores: TSESLint.FlatConfig.Config = {
    name: "global ignores",
    ignores: [
        "_tsout/**/*",
        "_tsout/*",
        "_tsout/",
        "cjs/**/*",
        "cjs/*/*",
        "cjs/*",
        "mjs/**/*",
        "mjs/*",
        "mjs/",
        "node_modules/**/*",
        "**/node_modules/**/*"
    ]
};

export default tseslint.config(
    {
        name: "flat/recommended-with-json - https://github.com/ota-meshi/eslint-plugin-jsonc",
        extends: jsonc.configs["flat/recommended-with-json"],
        files: [
            "*.json",
            "**/*.json"
        ],
        ignores: globalIgnores.ignores
    },
    {
        name: "flat/recommended-with-json5 - https://github.com/ota-meshi/eslint-plugin-jsonc",
        extends: jsonc.configs["flat/recommended-with-json5"],
        files: [
            "*.json5",
            "**/*.json5"
        ],
        ignores: globalIgnores.ignores
    },
    {
        name: "flat/recommended-with-jsonc - https://github.com/ota-meshi/eslint-plugin-jsonc",
        extends: jsonc.configs["flat/recommended-with-jsonc"],
        files: [
            "*.jsonc",
            "**/*.jsonc"
        ],
        ignores: globalIgnores.ignores
    },
    {
        name: "TSJS",
        extends: [
            eslint.configs.recommended as TSESLint.FlatConfig.Config,
            ...tseslint.configs.strict,
            ...tseslint.configs.stylistic
        ],
        files: [
            "**/*.ts",
            "**/*.cts",
            "**/*.mts",
            "**/*.js",
            "**/*.cjs",
            "**/*.mjs"
        ],
        ignores: globalIgnores.ignores,
        languageOptions: {
            parserOptions: {
                project: true,
                // @ts-expect-error TS2322 Type '{ allowDefaultProjectForFiles: string[]; }' is not assignable to type 'boolean | undefined'.
                EXPERIMENTAL_useProjectService: {
                    allowDefaultProjectForFiles: [
                        "./*.js"
                    ],
                    maximumDefaultProjectFileMatchCount_THIS_WILL_SLOW_DOWN_LINTING: 32
                }
            },
            globals: globals.node
        }
    },
    globalIgnores
);

No top-level awaits in the source, but the globals import is part of the problem here.
Searching through stack variables in a debug session reveals damning information at the following in source at th

Module.render (c:\Repos\HaloSPV3\hce.shared-config\node_modules\rollup\dist\es\shared\node-entry.js:14172)
Chunk.renderModules (c:\Repos\HaloSPV3\hce.shared-config\node_modules\rollup\dist\es\shared\node-entry.js:16734)
Chunk.render (c:\Repos\HaloSPV3\hce.shared-config\node_modules\rollup\dist\es\shared\node-entry.js:16230)
<anonymous> (c:\Repos\HaloSPV3\hce.shared-config\node_modules\rollup\dist\es\shared\node-entry.js:17907)
renderChunks (c:\Repos\HaloSPV3\hce.shared-config\node_modules\rollup\dist\es\shared\node-entry.js:17907)
Bundle.generate (c:\Repos\HaloSPV3\hce.shared-config\node_modules\rollup\dist\es\shared\node-entry.js:18145)
process.processTicksAndRejections (internal/process/task_queues:95)
await (Unknown Source:0)
processTicksAndRejections (internal/process/task_queues:95)
await (Unknown Source:0)
<anonymous> (c:\Repos\HaloSPV3\hce.shared-config\node_modules\rollup\dist\es\shared\node-entry.js:20692)
catchUnfinishedHookActions (c:\Repos\HaloSPV3\hce.shared-config\node_modules\rollup\dist\es\shared\node-entry.js:20119)
handleGenerateWrite (c:\Repos\HaloSPV3\hce.shared-config\node_modules\rollup\dist\es\shared\node-entry.js:20690)
processTicksAndRejections (internal/process/task_queues:95)
await (Unknown Source:0)
write (c:\Repos\HaloSPV3\hce.shared-config\node_modules\rollup\dist\es\shared\node-entry.js:20645)
<anonymous> (c:\Repos\HaloSPV3\hce.shared-config\node_modules\packemon\mjs\Artifact.mjs:98)
buildCode (c:\Repos\HaloSPV3\hce.shared-config\node_modules\packemon\mjs\Artifact.mjs:89)
processTicksAndRejections (internal/process/task_queues:95)

const source = this.magicString.clone()
^

{
  start: 0,
  end: 92,
  original: "const globals = await (typeof process === \"object\" && process.versions?.node ? Promise.all([",
  intro: "",
  outro: "",
  content: "const globals = await (typeof process === \"object\" && process.versions?.node ? Promise.all([",
  storeName: false,
  edited: false,
  previous: null,
  next: {
    start: 92,
    end: 99,
    original: "import(",
    intro: "",
    outro: "",
    content: "import(",
    storeName: undefined,
    edited: true,
    previous: [Circular],
    next: {
      start: 99,
      end: 103,
      original: "\"fs\"",
      intro: "",
      outro: "",
      content: "'node:fs'",
      storeName: undefined,
      edited: true,
      previous: [Circular],
      next: {
        start: 103,
        end: 104,
        original: ")",
        intro: "",
        outro: "",
        content: ")",
        storeName: undefined,
        edited: true,
        previous: [Circular],
        next: {
          start: 104,
          end: 106,
          original: ", ",
          intro: "",
          outro: "",
          content: ", ",
          storeName: false,
          edited: false,
          previous: [Circular],
          next: {
            start: 106,
            end: 113,
            original: "import(",
            intro: "",
            outro: "",
            content: "import(",
            storeName: undefined,
            edited: true,
            previous: [Circular],
            next: {
              start: 113,
              end: 121,
              original: "\"module\"",
              intro: "",
              outro: "",
              content: "'node:module'",
              storeName: undefined,
              edited: true,
              previous: [Circular],
              next: {
                start: 121,
                end: 122,
                original: ")",
                intro: "",
                outro: "",
                content: ")",
                storeName: undefined,
                edited: true,
                previous: [Circular],
                next: {
                  start: 122,
                  end: 240,
                  original: "]).then(([fs, module]) => new Promise((a => (r, j) => fs.readFile(a, (e, d) => e ? j(e) : r(d)))(module.createRequire(",
                  intro: "",
                  outro: "",
                  content: "]).then(([fs, module]) => new Promise((a => (r, j) => fs.readFile(a, (e, d) => e ? j(e) : r(d)))(module.createRequire(",
                  storeName: false,
                  edited: false,
                  previous: [Circular],
                  next: {
                    start: 240,
                    end: 255,
                    original: "import.meta.url",
                    intro: "",
                    outro: "",
                    content: "(typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.src || new URL('eslintConfig.cjs', document.baseURI).href))",
                    storeName: undefined,
                    edited: true,
                    previous: [Circular],
                    next: {
                      start: 255,
                      end: 304,
                      original: ").resolve(\"globals\")))).then(JSON.parse) : fetch(",
                      intro: "",
                      outro: "",
                      content: ").resolve(\"globals\")))).then(JSON.parse) : fetch(",
                      storeName: false,
                      edited: false,
                      previous: [Circular],
                      next: {
                        start: 304,
                        end: 323,
                        original: "import.meta.resolve",
                        intro: "",
                        outro: "",
                        content: "undefined",
                        storeName: undefined,
                        edited: true,
                        previous: [Circular],
                        next: {
                          start: 323,
                          end: 359,
                          original: "?.(\"globals\") ?? new URL(\"globals\", ",
                          intro: "",
                          outro: "",
                          content: "?.(\"globals\") ?? new URL(\"globals\", ",
                          storeName: false,
                          edited: false,
                          previous: [Circular],
                          next: {
                            start: 359,
                            end: 374,
                            original: "import.meta.url",
                            intro: "",
                            outro: "",
                            content: "(typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.src || new URL('eslintConfig.cjs', document.baseURI).href))",
                            storeName: undefined,
                            edited: true,
                            previous: [Circular],
                            next: {
                              start: 374,
                              end: 399,
                              original: ")).then(r => r.json()));\n",
                              intro: "",
                              outro: "",
                              content: ")).then(r => r.json()));\n",
                              storeName: false,
                              edited: false,
                              previous: [Circular],
                              next: {
                                start: 399,
                                end: 440,
                                original: "import jsonc from \"eslint-plugin-jsonc\";\n",
                                intro: "",
                                outro: "",
                                content: "",
                                storeName: undefined,
                                edited: true,
                                previous: [Circular],
                                next: {
                                  start: 440,
                                  end: 482,
                                  original: "import tseslint from \"typescript-eslint\";\n",
                                  intro: "",
                                  outro: "",
                                  content: "",
                                  storeName: undefined,
                                  edited: true,
                                  previous: [Circular],
                                  next: {
                                    start: 482,
                                    end: 515,
                                    original: "import eslint from \"@eslint/js\";\n",
                                    intro: "",
                                    outro: "",
                                    content: "",
                                    storeName: undefined,
                                    edited: true,
                                    previous: [Circular],
                                    next: {
                                      start: 515,
                                      end: 1115,
                                      original: "// import { createRequire } from \"module\";\n\n// const require = createRequire(import.meta.url);\n// const globals = require(\"globals\") as typeof import(\"globals\", {with: {type: \"json\"}});\n\n// https://eslint.org/docs/latest/use/configure/migration-guide#using-eslintrc-configs-in-flat-config\n// https://www.google.com/search?q=javascript+recurse+through+object+and+remove+undefined+properties\n\nconst globalIgnores = {\n  name: \"global ignores\",\n  ignores: [\"_tsout/**/*\", \"_tsout/*\", \"_tsout/\", \"cjs/**/*\", \"cjs/*/*\", \"cjs/*\", \"mjs/**/*\", \"mjs/*\", \"mjs/\", \"node_modules/**/*\", \"**/node_modules/**/*\"]\n};\n",
                                      intro: "",
                                      outro: "",
                                      content: "// import { createRequire } from \"module\";\n\n// const require = createRequire(import.meta.url);\n// const globals = require(\"globals\") as typeof import(\"globals\", {with: {type: \"json\"}});\n\n// https://eslint.org/docs/latest/use/configure/migration-guide#using-eslintrc-configs-in-flat-config\n// https://www.google.com/search?q=javascript+recurse+through+object+and+remove+undefined+properties\n\nconst globalIgnores = {\n  name: \"global ignores\",\n  ignores: [\"_tsout/**/*\", \"_tsout/*\", \"_tsout/\", \"cjs/**/*\", \"cjs/*/*\", \"cjs/*\", \"mjs/**/*\", \"mjs/*\", \"mjs/\", \"node_modules/**/*\", \"**/node_modules/**/*\"]\n};\n",
                                      storeName: false,
                                      edited: false,
                                      previous: [Circular],
                                      next: {
                                        start: 1115,
                                        end: 1130,
                                        original: "export default ",
                                        intro: "",
                                        outro: "",
                                        content: "const eslintConfig = ",
                                        storeName: undefined,
                                        edited: true,
                                        previous: [Circular],
                                        next: {
                                          start: 1130,
                                          end: 1138,
                                          original: "tseslint",
                                          intro: "",
                                          outro: "",
                                          content: "tseslint__default.default",
                                          storeName: true,
                                          edited: true,
                                          previous: [Circular],
                                          next: {
                                            start: 1138,
                                            end: 1248,
                                            original: ".config({\n  name: \"flat/recommended-with-json - https://github.com/ota-meshi/eslint-plugin-jsonc\",\n  extends: ",
                                            intro: "",
                                            outro: "",
                                            content: ".config({\n  name: \"flat/recommended-with-json - https://github.com/ota-meshi/eslint-plugin-jsonc\",\n  extends: ",
                                            storeName: false,
                                            edited: false,
                                            previous: [Circular],
                                            next: {
                                              start: 1248,
                                              end: 1253,
                                              original: "jsonc",
                                              intro: "",
                                              outro: "",
                                              content: "jsonc__default.default",
                                              storeName: true,
                                              edited: true,
                                              previous: [Circular],
                                              next: {
                                                start: 1253,
                                                end: 1466,
                                                original: ".configs[\"flat/recommended-with-json\"],\n  files: [\"*.json\", \"**/*.json\"],\n  ignores: globalIgnores.ignores\n}, {\n  name: \"flat/recommended-with-json5 - https://github.com/ota-meshi/eslint-plugin-jsonc\",\n  extends: ",
                                                intro: "",
                                                outro: "",
                                                content: ".configs[\"flat/recommended-with-json\"],\n  files: [\"*.json\", \"**/*.json\"],\n  ignores: globalIgnores.ignores\n}, {\n  name: \"flat/recommended-with-json5 - https://github.com/ota-meshi/eslint-plugin-jsonc\",\n  extends: ",
                                                storeName: false,
                                                edited: false,
                                                previous: [Circular],
                                                next: {
                                                  start: 1466,
                                                  end: 1471,
                                                  original: "jsonc",
                                                  intro: "",
                                                  outro: "",
                                                  content: "jsonc__default.default",
                                                  storeName: true,
                                                  edited: true,
                                                  previous: [Circular],
                                                  next: {
                                                    start: 1471,
                                                    end: 1687,
                                                    original: ".configs[\"flat/recommended-with-json5\"],\n  files: [\"*.json5\", \"**/*.json5\"],\n  ignores: globalIgnores.ignores\n}, {\n  name: \"flat/recommended-with-jsonc - https://github.com/ota-meshi/eslint-plugin-jsonc\",\n  extends: ",
                                                    intro: "",
                                                    outro: "",
                                                    content: ".configs[\"flat/recommended-with-json5\"],\n  files: [\"*.json5\", \"**/*.json5\"],\n  ignores: globalIgnores.ignores\n}, {\n  name: \"flat/recommended-with-jsonc - https://github.com/ota-meshi/eslint-plugin-jsonc\",\n  extends: ",
                                                    storeName: false,
                                                    edited: false,
                                                    previous: [Circular],
                                                    next: {
                                                      start: 1687,
                                                      end: 1692,
                                                      original: "jsonc",
                                                      intro: "",
                                                      outro: "",
                                                      content: "jsonc__default.default",
                                                      storeName: true,
                                                      edited: true,
                                                      previous: [Circular],
                                                      next: {
                                                        start: 1692,
                                                        end: 1835,
                                                        original: ".configs[\"flat/recommended-with-jsonc\"],\n  files: [\"*.jsonc\", \"**/*.jsonc\"],\n  ignores: globalIgnores.ignores\n}, {\n  name: \"TSJS\",\n  extends: [",
                                                        intro: "",
                                                        outro: "",
                                                        content: ".configs[\"flat/recommended-with-jsonc\"],\n  files: [\"*.jsonc\", \"**/*.jsonc\"],\n  ignores: globalIgnores.ignores\n}, {\n  name: \"TSJS\",\n  extends: [",
                                                        storeName: false,
                                                        edited: false,
                                                        previous: [Circular],
                                                        next: {
                                                          start: 1835,
                                                          end: 1841,
                                                          original: "eslint",
                                                          intro: "",
                                                          outro: "",
                                                          content: "eslint__default.default",
                                                          storeName: true,
                                                          edited: true,
                                                          previous: [Circular],
                                                          next: {
                                                            start: 1841,
                                                            end: 1866,
                                                            original: ".configs.recommended, ...",
                                                            intro: "",
                                                            outro: "",
                                                            content: ".configs.recommended, ...",
                                                            storeName: false,
                                                            edited: false,
                                                            previous: [Circular],
                                                            next: {
                                                              start: 1866,
                                                              end: 1874,
                                                              original: "tseslint",
                                                              intro: "",
                                                              outro: "",
                                                              content: "tseslint__default.default",
                                                              storeName: true,
                                                              edited: true,
                                                              previous: [Circular],
                                                              next: {
                                                                start: 1874,
                                                                end: 1894,
                                                                original: ".configs.strict, ...",
                                                                intro: "",
                                                                outro: "",
                                                                content: ".configs.strict, ...",
                                                                storeName: false,
                                                                edited: false,
                                                                previous: [Circular],
                                                                next: {
                                                                  start: 1894,
                                                                  end: 1902,
                                                                  original: "tseslint",
                                                                  intro: "",
                                                                  outro: "",
                                                                  content: "tseslint__default.default",
                                                                  storeName: true,
                                                                  edited: true,
                                                                  previous: [Circular],
                                                                  next: {
                                                                    start: 1902,
                                                                    end: 2461,
                                                                    original: ".configs.stylistic],\n  files: [\"**/*.ts\", \"**/*.cts\", \"**/*.mts\", \"**/*.js\", \"**/*.cjs\", \"**/*.mjs\"],\n  ignores: globalIgnores.ignores,\n  languageOptions: {\n    parserOptions: {\n      project: true,\n      // @ts-expect-error TS2322 Type '{ allowDefaultProjectForFiles: string[]; }' is not assignable to type 'boolean | undefined'.\n      EXPERIMENTAL_useProjectService: {\n        allowDefaultProjectForFiles: [\"./*.js\"],\n        maximumDefaultProjectFileMatchCount_THIS_WILL_SLOW_DOWN_LINTING: 32\n      }\n    },\n    globals: globals.node\n  }\n}, globalIgnores);",
                                                                    intro: "",
                                                                    outro: "",
                                                                    content: ".configs.stylistic],\n  files: [\"**/*.ts\", \"**/*.cts\", \"**/*.mts\", \"**/*.js\", \"**/*.cjs\", \"**/*.mjs\"],\n  ignores: globalIgnores.ignores,\n  languageOptions: {\n    parserOptions: {\n      project: true,\n      // @ts-expect-error TS2322 Type '{ allowDefaultProjectForFiles: string[]; }' is not assignable to type 'boolean | undefined'.\n      EXPERIMENTAL_useProjectService: {\n        allowDefaultProjectForFiles: [\"./*.js\"],\n        maximumDefaultProjectFileMatchCount_THIS_WILL_SLOW_DOWN_LINTING: 32\n      }\n    },\n    globals: globals.node\n  }\n}, globalIgnores);",
                                                                    storeName: false,
                                                                    edited: false,
                                                                    previous: [Circular],
                                                                    next: null,
                                                                  },
                                                                },
                                                              },
                                                            },
                                                          },
                                                        },
                                                      },
                                                    },
                                                  },
                                                },
                                              },
                                            },
                                          },
                                        },
                                      },
                                    },
                                  },
                                },
                              },
                            },
                          },
                        },
                      },
                    },
                  },
                },
              },
            },
          },
        },
      },
    },
  },
}

This is, of course, manually resolveable by replacing the static import with a require, but that also means we can't use the import attributes to confirm it's a json module.

@BinToss
Copy link
Author

BinToss commented May 24, 2024

Or I could save myself the headache and finally drop CJS entirely. I've been delaying that breaking change for no one's benefit.

@milesj milesj reopened this May 24, 2024
@milesj
Copy link
Owner

milesj commented May 24, 2024

I'm not sure what the fix would be here without removing the plugin itself?

Seems like a bug in babel itself if it's injecting await into a CJS module.

@BinToss
Copy link
Author

BinToss commented May 26, 2024

If I find the time to do so, I'll checkout and debug my previous configuration to determine why packemon 4.0.1 with this plugin added wasn't inserting a top-level await. If it behaves differently than it did a few weeks ago, then you're right and it's a new bug in Babel or one of its plugins.

@milesj
Copy link
Owner

milesj commented May 26, 2024

I also enabled this: https://babeljs.io/docs/babel-plugin-proposal-json-modules

But it looks like it should support CJS.

When I enabled it, all the snapshots showed the file data being resolved correctly, so there was no await used at all. https://github.com/milesj/packemon/pull/256/files

What's your full config? Maybe its a certain combination causing it.

@BinToss
Copy link
Author

BinToss commented May 28, 2024

I also enabled this: https://babeljs.io/docs/babel-plugin-proposal-json-modules

I only realize this now: my Packemon 4.0.1 config did not include that plugin. As it states, that plugin transforms json module imports to platform-dependent implementations instead of allowing the platform's runtime to handle the attribute.
This issue likely would have occurred in my previous config if I had included this plugin.

I did some debugging and found that a targets variable (inside a function-variable of babel-plugin-proposal-json-modules; a function which is executed later) was being assigned undefined. Its value is used to derive if the plugin outputs CommonJS or EcmaScript.
Unfortunately, Rollup's and Babel's compiled code optimizes a lot of variables and anonymous functions away; they are more difficult to debug than I'd expected.

@milesj
Copy link
Owner

milesj commented May 28, 2024

Let me remove that plugin for now and only support with assertions.

@milesj
Copy link
Owner

milesj commented May 28, 2024

Try 4.1.1

@BinToss
Copy link
Author

BinToss commented May 29, 2024

No issues building (edit: and running) with packemon 4.1.1.

While debugging 4.1.0, I tried a few things and eventually got the await removed and the const global moved further down the file, but a import.meta.resolve call was replaced with undefined, so the code was invalid anyway.

@milesj
Copy link
Owner

milesj commented May 29, 2024

Cool. I'll close this for now and revisit in the future.

@milesj milesj closed this as completed May 29, 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

2 participants