ProjectEvergreen / wcc

Experimental native Web Components compiler.
https://merry-caramel-524e61.netlify.app
90 stars 7 forks source link

error for missing acorn-jsx package #150

Closed thescientist13 closed 8 months ago

thescientist13 commented 8 months ago

Summary

Getting this after upgrading to the latest version

➜  greenwood-demo-adapter-vercel git:(chore/upgrade-greenwood-0.30.0) ✗ npm run dev

> greenwood-demo-adapter-vercel@1.0.0 dev
> greenwood develop

-------------------------------------------------------
Welcome to Greenwood (v0.30.0-alpha.0) ♻️
-------------------------------------------------------
Initializing project config
Initializing project workspace contexts
Generating graph of workspace files...
building from local sources...

node:internal/process/promises:288
            triggerUncaughtException(err, true /* fromPromise */);
            ^
Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'acorn-jsx' imported from /Users/owenbuckley/Workspace/project-evergreen/greenwood-demo-adapter-vercel/node_modules/wc-compiler/src/jsx-loader.js
    at new NodeError (node:internal/errors:393:5)
    at packageResolve (node:internal/modules/esm/resolve:860:9)
    at moduleResolve (node:internal/modules/esm/resolve:909:20)
    at defaultResolve (node:internal/modules/esm/resolve:1124:11)
    at nextResolve (node:internal/modules/esm/loader:163:28)
    at ESMLoader.resolve (node:internal/modules/esm/loader:841:30)
    at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:76:40)
    at link (node:internal/modules/esm/module_job:75:36) {
  code: 'ERR_MODULE_NOT_FOUND'
}

Details

Not sure how this made it through the entire lifecycle, but looking at #142 we completely forget to update the import in the code? Looks we are still referecning acorn-jsx 🤦 https://github.com/ProjectEvergreen/wcc/blob/0.12.0/src/jsx-loader.js#L7C1-L7C29

# current
import jsx from 'acorn-jsx';

# should be
import jsx from '@projectevergreen/acorn-jsx-esm';