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

remove classic runtime for react #124

Merged
merged 2 commits into from
Nov 30, 2023

Conversation

afkcodes
Copy link
Contributor

@afkcodes afkcodes commented Nov 29, 2023

the classic jsx runtime expects react import to be present in every file, but not every page or component is using something directly from react, so its unused, some of the editor has settings to remove unused imports this is where it breaks the application as it removes the unused react import.

@magne4000
Copy link
Member

magne4000 commented Nov 30, 2023

Sadly this still seems to cause the following error in automatic mode (mentionned in the comment above the option):

TypeError: jsxDEV is not a function
      at HeadDefault (file:///tmp/bati/packages/react--vercel--hattip--eslint/dist/server/chunks/chunk-FcSTImHZ.js:4:71)
      at Uc (/tmp/bati/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:70:44)
      at Xc (/tmp/bati/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:72:253)
      at Z (/tmp/bati/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:78:89)
      at Xc (/tmp/bati/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:76:231)
      at Z (/tmp/bati/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:78:89)
      at Xc (/tmp/bati/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:72:481)
      at Z (/tmp/bati/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:78:89)
      at Xc (/tmp/bati/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:73:476)
      at Z (/tmp/bati/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:78:89)

There probably is another solution , but I haven't found it yet.

@magne4000
Copy link
Member

magne4000 commented Nov 30, 2023

The error only occurs for the combination React + Vercel + HatTip.
I'll just activate the "classic" option for this use case then.

@magne4000 magne4000 merged commit 185576a into vikejs:main Nov 30, 2023
3 checks passed
@afkcodes
Copy link
Contributor Author

i guess there is no role of vercel here, probably hatTip might be the one that might be erroring out. but needs to be checked

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

Successfully merging this pull request may close these issues.

3 participants