question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Babel ^7.12.0 breaks preact jsx-runtime export

See original GitHub issue

Hi,

due to this change in babel https://github.com/babel/babel/pull/12116/commits/d6b0822ee9e95321a417b321a6687048faf1c3a1, the preact jsx runtime can’t be imported anymore. Preact exports the jsx-runtime as folder, but babel expects a file with file ending .js now (${source}/jsx-runtime.js and ${source}/jsx-dev-runtime.js).

Module not found: Error: Can't resolve 'preact/jsx-runtime.js'

Is that something we should address at the babel repo, or do we need to change how the runtime is exported in preact?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
nicolo-ribaudocommented, Oct 19, 2020

Fixed in @babel/helper-builder-react-jsx-experimental@7.12.4

0reactions
developitcommented, Dec 2, 2020

I’m guessing this is something strange “craco” is doing.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error with JSX in my React Library when Switching to Preact
IF I publish the un-babel'd code and it is simply the source cope at the top written in new ECMAScript, I get an...
Read more >
React Ecosystem: Setting up Babel 7 and Webpack 5 for React
With v7, Babel introduced some breaking changes and has decided to move away from the above approach and started shipping each feature ...
Read more >
Getting Started | Preact: Fast 3kb React alternative with the ...
This guide helps you get up and running to start developing Preact apps, using 3 popular options. If you're new to Preact, we...
Read more >
Introducing the New JSX Transform – React Blog
Together with the React 17 release, we've wanted to make a few improvements to the JSX transform, but we didn't want to break...
Read more >
preact-emotion-babel-plugin - CodeSandbox
Forked Frompreact-emotion-babel-plugin; Environmentpreact-cli. Files. src. index.js. styled.js .babelrc. package.json. sandbox.config.json. Dependencies.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found