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

Error when using this with React #4

Open
5 tasks done
uchihamalolan opened this issue Aug 8, 2022 · 0 comments
Open
5 tasks done

Error when using this with React #4

uchihamalolan opened this issue Aug 8, 2022 · 0 comments

Comments

@uchihamalolan
Copy link

Describe the bug

When bundler is rollup, there is some error when trying to execute export packages

I think this issue might be fixed if @rollup/plugin-commonjs is used


npx export-size . --bundler "rollup"
████████████████████████████████████████ 0/0 Error: 'jsx' is not exported by node_modules/react/jsx-runtime.js, imported by dist/coms
    at error (/Users/malolan/.npm/_npx/614a55f223c4d059/node_modules/rollup/dist/shared/rollup.js:198:30)
    at Module.error (/Users/malolan/.npm/_npx/614a55f223c4d059/node_modules/rollup/dist/shared/rollup.js:12543:16)
    at Module.traceVariable (/Users/malolan/.npm/_npx/614a55f223c4d059/node_modules/rollup/dist/shared/rollup.js:12902:29)
    at ModuleScope.findVariable (/Users/malolan/.npm/_npx/614a55f223c4d059/node_modules/rollup/dist/shared/rollup.js:11554:39)
    at FunctionScope.findVariable (/Users/malolan/.npm/_npx/614a55f223c4d059/node_modules/rollup/dist/shared/rollup.js:6486:38)
    at ChildScope.findVariable (/Users/malolan/.npm/_npx/614a55f223c4d059/node_modules/rollup/dist/shared/rollup.js:6486:38)
    at Identifier.bind (/Users/malolan/.npm/_npx/614a55f223c4d059/node_modules/rollup/dist/shared/rollup.js:7553:40)
    at CallExpression.bind (/Users/malolan/.npm/_npx/614a55f223c4d059/node_modules/rollup/dist/shared/rollup.js:5383:23)
    at CallExpression.bind (/Users/malolan/.npm/_npx/614a55f223c4d059/node_modules/rollup/dist/shared/rollup.js:9049:15)
    at ReturnStatement.bind (/Users/malolan/.npm/_npx/614a55f223c4d059/node_modules/rollup/dist/shared/rollup.js:5383:23) {
  code: 'MISSING_EXPORT',
  url: 'https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module',
  id: '/Users/malolan/Growfin/pkgexp/cashapps/dist/components/Alert/index.js',
  pos: 9,
  loc: {
    column: 9,
    file: '/Users/malolan/Growfin/pkgexp/cashapps/dist/components/Alert/index.js',
    line: 1
  },
  frame: "1: import { jsx } from 'react/jsx-runtime';\n" +
    '            ^\n' +
    "2: import { Alert } from 'antd';",
  watchFiles: [
    'export-size-virtual',
    '/Users/malolan/Growfin/pkgexp/cashapps/dist/index.js',
    '/Users/malolan/Growfin/pkgexp/cashapps/dist/components/Heyo.js',
    '/Users/malolan/Growfin/pkgexp/cashapps/dist/components/Hello/index.js',
    '/Users/malolan/Growfin/pkgexp/cashapps/dist/components/World/index.js',
    '/Users/malolan/Growfin/pkgexp/cashapps/dist/components/Counter/index.js',
    '/Users/malolan/Growfin/pkgexp/cashapps/dist/components/CurrentUserBio/index.js',
    '/Users/malolan/Growfin/pkgexp/cashapps/dist/components/CashAppsQueryClient/index.js',
    '/Users/malolan/Growfin/pkgexp/cashapps/dist/pages/Payments/index.js',
    '/Users/malolan/Growfin/pkgexp/cashapps/dist/utils/fetcher.js',
    '/Users/malolan/Growfin/pkgexp/cashapps/dist/utils/query-client.js',
    '/Users/malolan/Growfin/pkgexp/cashapps/dist/components/Alert/index.js',
    '/Users/malolan/Growfin/pkgexp/cashapps/node_modules/react/jsx-runtime.js'
  ]

Reproduction

https://github.com/ma101an/cashapps

System Info

System:
    OS: macOS 12.5
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 36.62 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.15.1 - ~/Library/Caches/fnm_multishells/73842_1659985333292/bin/node
    Yarn: 1.22.15 - ~/Library/Caches/fnm_multishells/73842_1659985333292/bin/yarn
    npm: 8.12.1 - ~/Library/Caches/fnm_multishells/73842_1659985333292/bin/npm
    Watchman: 2022.03.21.00 - /usr/local/bin/watchman
  Browsers:
    Brave Browser: 103.1.41.100
    Firefox Developer Edition: 104.0
    Safari: 15.6

Used Package Manager

npm

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.
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

1 participant