imidom
Repos
6
Followers
19
Following
13

Frontend for Backpack's admin panel. Built with React and Redux.

Core Backpack API server. Built with JavaScript, Node.js, Express, MongoDB, Redis, and Nginx.

Backend for Backpack's admin panel. Built with JavaScript, Node.js, Express, PostgreSQL, and Redis.

SDK for calling Backpack API endpoints. Built with JavaScript (ES6).

Events

Remove link used for testing

Created at 1 month ago

put in link for testing

Created at 1 month ago
Created at 1 month ago
opened issue
@babel/plugin-transform-react-jsx-source warning appears regardless of configuration
  • [ ] Check if updating to the latest Preact version resolves the issue

Describe the bug Throwing an error within a Preact application with preact/debug enabled always logs the following warning in the dev console:

Add @babel/plugin-transform-react-jsx-source to get a more detailed component stack. Note that you should not add it to production builds of your App for bundle size reasons.

Adding @babel/plugin-transform-react-jsx-source to my babel configuration does not stop the warning.

This warning is logged from here in component-stack.js. https://github.com/preactjs/preact/blob/d4089df1263faab9b980a3493a4c7e986f254f8e/debug/src/component-stack.js#L90-L95

Looking at that file, I don't believe that hasBabelPlugin is ever set to true. Unfortunately, I don't know how to detect the presence or absence of a babel plugin, otherwise I'd suggest a patch!

To Reproduce

(I could not reproduce this in the provided codesandbox environment, maybe because it's using react-error-overlay?)

Example repo: https://github.com/imidom/preact-warning-example

  1. Create a new Preact application using the latest version of preact-cli: npx preact-cli create default lol2
  2. Put an undefined variable into <App /> like the following:
    ...
    <Header />
     {eekAnUndefinedVariableThatWillCauseAnException}
    <Router>
    ...
    
  3. Run the application: npm run dev
  4. Load the application with your dev console open image

Expected behavior The error is logged without an accompanying warning about a missing babel plugin if the babel plugin has, in fact, been loaded. Though I was not able to see any difference in output with the plugin installed or removed.

Created at 1 month ago
imidom create branch main
Created at 1 month ago
create repository
imidom create repository
Created at 1 month ago