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

adopt a bundle friendly and ESM compatible version of acorn-jsx #142

Closed
thescientist13 opened this issue Feb 10, 2024 · 0 comments · Fixed by #143
Closed

adopt a bundle friendly and ESM compatible version of acorn-jsx #142

thescientist13 opened this issue Feb 10, 2024 · 0 comments · Fixed by #143
Assignees
Labels
0.12.0 feature New feature or request
Milestone

Comments

@thescientist13
Copy link
Member

Summary

In needing to open up Rollup to additional exportConditions in Greenwood, it has become a bit of a blocker that acorn-jsx is not in ESM, which causes issue when going through Node's ESM loader.

Otherwise, we will get this error

  Error when using sourcemap for reporting an error: Can't resolve original location of error.
Error: 'default' is not exported by /Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/acorn/dist/acorn.mjs?commonjs-proxy, imported by ../../../../../node_modules/acorn-jsx/index.js
    at error (file:///Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/rollup/dist/es/shared/rollup.js:1858:30)
    at Module.error (file:///Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/rollup/dist/es/shared/rollup.js:12429:16)
    at Module.traceVariable (file:///Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/rollup/dist/es/shared/rollup.js:12788:29)
    at ModuleScope.findVariable (file:///Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/rollup/dist/es/shared/rollup.js:11440:39)
    at FunctionScope.findVariable (file:///Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/rollup/dist/es/shared/rollup.js:6372:38)
    at ChildScope.findVariable (file:///Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/rollup/dist/es/shared/rollup.js:6372:38)
    at FunctionScope.findVariable (file:///Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/rollup/dist/es/shared/rollup.js:6372:38)
    at ChildScope.findVariable (file:///Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/rollup/dist/es/shared/rollup.js:6372:38)
    at Identifier.bind (file:///Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/rollup/dist/es/shared/rollup.js:7439:40)
    at CallExpression.bind (file:///Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/rollup/dist/es/shared/rollup.js:5265:73) {
  code: 'MISSING_EXPORT',
  url: 'https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module',
  id: '/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/acorn-jsx/index.js',
  pos: 375,
  loc: {
    column: 7,
    file: '/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/acorn-jsx/index.js',
    line: 6
  },
  frame: '4: import require$$0 from "\\u0000./xhtml?commonjs-proxy";\n' +
    '5: import "\\u0000acorn?commonjs-require";\n' +
    '6: import require$$1 from "\\u0000acorn?commonjs-proxy";\n' +
    '          ^\n' +
    '7: \n' +
    '8: (function (module) {',
  watchFiles: [
    '/Users/owenbuckley/Workspace/project-evergreen/greenwood/packages/cli/test/cases/serve.default.ssr/.greenwood/_artists.js',
    '/Users/owenbuckley/Workspace/project-evergreen/greenwood/packages/cli/test/cases/serve.default.ssr/.greenwood/_index.js',
    '/Users/owenbuckley/Workspace/project-evergreen/greenwood/packages/cli/test/cases/serve.default.ssr/.greenwood/_post.js',
    '/Users/owenbuckley/Workspace/project-evergreen/greenwood/packages/cli/test/cases/serve.default.ssr/.greenwood/_users.js',
    '/Users/owenbuckley/Workspace/project-evergreen/greenwood/packages/cli/test/cases/serve.default.ssr/src/pages/post.js',
    '/Users/owenbuckley/Workspace/project-evergreen/greenwood/packages/cli/test/cases/serve.default.ssr/src/pages/users.js',
    '/Users/owenbuckley/Workspace/project-evergreen/greenwood/packages/cli/test/cases/serve.default.ssr/src/pages/index.js',
    '/Users/owenbuckley/Workspace/project-evergreen/greenwood/packages/cli/test/cases/serve.default.ssr/src/pages/artists.js',
    '/Users/owenbuckley/Workspace/project-evergreen/greenwood/packages/cli/test/cases/serve.default.ssr/src/components/card.js',
    '/Users/owenbuckley/Workspace/project-evergreen/greenwood/packages/cli/src/lib/execute-route-module.js',
    '/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/wc-compiler/src/wcc.js',
    '/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/wc-compiler/src/jsx-loader.js',
    '/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/wc-compiler/src/dom-shim.js',
    '/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/acorn-walk/dist/walk.mjs',
    '/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/acorn/dist/acorn.mjs',
    '/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/escodegen/escodegen.js',
    '/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/parse5/lib/index.js',
    '\x00commonjsHelpers.js',
    '\x00/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/escodegen/escodegen.js?commonjs-exports',
    '\x00/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/parse5/lib/index.js?commonjs-exports',
    '/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/acorn-jsx/index.js',
    '\x00/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/acorn-jsx/index.js?commonjs-module',
    '/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/escodegen/node_modules/source-map/source-map.js',
    '\x00/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/escodegen/node_modules/source-map/source-map.js?commonjs-proxy',
    '/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/parse5/lib/serializer/index.js',
    '\x00/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/parse5/lib/serializer/index.js?commonjs-proxy',
    '/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/parse5/lib/parser/index.js',
    '\x00/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/parse5/lib/parser/index.js?commonjs-proxy',
    '\x00/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/escodegen/node_modules/source-map/source-map.js?commonjs-exports',
    '/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/estraverse/estraverse.js',
    '\x00/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/estraverse/estraverse.js?commonjs-proxy',
    '\x00/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/esutils/lib/utils.js?commonjs-proxy',
    '/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/esutils/lib/utils.js',
    '/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/acorn-jsx/xhtml.js',
    '\x00/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/acorn-jsx/xhtml.js?commonjs-proxy',
    '\x00/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/estraverse/estraverse.js?commonjs-exports',
    '\x00/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/acorn/dist/acorn.mjs?commonjs-proxy',
    '\x00/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/esutils/lib/utils.js?commonjs-exports',
    '\x00/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/parse5/lib/parser/formatting-element-list.js?commonjs-proxy',
    '\x00/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/escodegen/node_modules/source-map/lib/source-map-generator.js?commonjs-proxy',
    '/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/parse5/lib/parser/formatting-element-list.js',
    '\x00/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/escodegen/node_modules/source-map/lib/source-map-consumer.js?commonjs-proxy',
    '\x00/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/parse5/lib/parser/open-element-stack.js?commonjs-proxy',
    '/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/escodegen/node_modules/source-map/lib/source-map-generator.js',
    '/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/parse5/lib/parser/open-element-stack.js',
    '/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/escodegen/node_modules/source-map/lib/source-map-consumer.js',
    '\x00/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/parse5/lib/tree-adapters/default.js?commonjs-proxy',
    '/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/parse5/lib/tree-adapters/default.js',
    '/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/parse5/lib/utils/merge-options.js',
    '\x00/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/parse5/lib/utils/mixin.js?commonjs-proxy',
    '\x00/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/parse5/lib/utils/merge-options.js?commonjs-proxy',
    '/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/parse5/lib/common/doctype.js',
    '\x00/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/parse5/lib/common/doctype.js?commonjs-proxy',
    '\x00/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/parse5/lib/common/html.js?commonjs-proxy',
    '/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/parse5/lib/common/html.js',
    '\x00/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/parse5/lib/common/error-codes.js?commonjs-proxy',
    '\x00/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/parse5/lib/common/foreign-content.js?commonjs-proxy',
    '\x00/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/escodegen/node_modules/source-map/lib/source-node.js?commonjs-proxy',
    '/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/parse5/lib/common/unicode.js',
    '/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/escodegen/node_modules/source-map/lib/source-node.js',
    '\x00/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/parse5/lib/common/unicode.js?commonjs-proxy',
    '/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/parse5/lib/common/error-codes.js',
    '/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/parse5/lib/utils/mixin.js',
    '/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/parse5/lib/common/foreign-content.js',
    '/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/parse5/lib/extensions/location-info/parser-mixin.js',
    '/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/parse5/lib/extensions/error-reporting/parser-mixin.js',
    '\x00/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/parse5/lib/extensions/error-reporting/parser-mixin.js?commonjs-proxy',
    '\x00/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/parse5/lib/extensions/location-info/parser-mixin.js?commonjs-proxy',
    '\x00/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/parse5/lib/tokenizer/index.js?commonjs-proxy',
    '/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/parse5/lib/tokenizer/index.js',
    '\x00/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/parse5/lib/tree-adapters/default.js?commonjs-exports',
    '\x00/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/parse5/lib/common/doctype.js?commonjs-exports',
    '\x00/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/parse5/lib/common/html.js?commonjs-exports',
    '/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/esutils/lib/ast.js',
    '\x00/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/esutils/lib/code.js?commonjs-proxy',
    '/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/esutils/lib/keyword.js',
    '\x00/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/esutils/lib/ast.js?commonjs-proxy',
    '\x00/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/esutils/lib/keyword.js?commonjs-proxy',
    '/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/esutils/lib/code.js',
    '\x00/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/escodegen/node_modules/source-map/lib/source-map-generator.js?commonjs-exports',
    '\x00/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/escodegen/node_modules/source-map/lib/source-map-consumer.js?commonjs-exports',
    '\x00/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/parse5/lib/common/unicode.js?commonjs-exports',
    '\x00/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/parse5/lib/common/foreign-content.js?commonjs-exports',
    '\x00/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/escodegen/node_modules/source-map/lib/source-node.js?commonjs-exports',
    '\x00/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/esutils/lib/ast.js?commonjs-module',
    '\x00/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/esutils/lib/keyword.js?commonjs-module',
    '\x00/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/esutils/lib/code.js?commonjs-module',
    '/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/escodegen/node_modules/source-map/lib/util.js',
    '\x00/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/escodegen/node_modules/source-map/lib/util.js?commonjs-proxy',
    '/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/escodegen/node_modules/source-map/lib/base64-vlq.js',
    '\x00/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/escodegen/node_modules/source-map/lib/base64-vlq.js?commonjs-proxy',
    '/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/escodegen/node_modules/source-map/lib/array-set.js',
    '\x00/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/escodegen/node_modules/source-map/lib/array-set.js?commonjs-proxy',
    '/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/escodegen/node_modules/source-map/lib/mapping-list.js',
    '\x00/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/escodegen/node_modules/source-map/lib/mapping-list.js?commonjs-proxy',
    '/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/escodegen/node_modules/source-map/lib/binary-search.js',
    '\x00/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/escodegen/node_modules/source-map/lib/binary-search.js?commonjs-proxy',
    '/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/escodegen/node_modules/source-map/lib/quick-sort.js',
    '\x00/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/escodegen/node_modules/source-map/lib/quick-sort.js?commonjs-proxy',
    '\x00/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/parse5/lib/tokenizer/preprocessor.js?commonjs-proxy',
    ... 24 more items
  ]
}
  

Details

Here are some related links, but the work has stalled out so I think we will need to fork our own version.

@thescientist13 thescientist13 added the feature New feature or request label Feb 10, 2024
@thescientist13 thescientist13 added this to the 1.0 milestone Feb 10, 2024
@thescientist13 thescientist13 moved this from 🏗 In progress to 🔖 Ready in [Greenwood] Phase 9 - Standards and Conventions Feb 10, 2024
@thescientist13 thescientist13 self-assigned this Feb 10, 2024
@thescientist13 thescientist13 moved this from 🔖 Ready to 👀 In review in [Greenwood] Phase 9 - Standards and Conventions Feb 11, 2024
@thescientist13 thescientist13 changed the title vendor a bundle friendly and ESM compatible version of acorn-jsx adopt a bundle friendly and ESM compatible version of acorn-jsx Mar 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.12.0 feature New feature or request
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

1 participant