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.

[Bug] React.jsx: type is invalid

See original GitHub issue

Describe the Bug

Sorry for bothering, but i just found an inevitable exception when i start my vue3 project without using any mdx file with @storybook/builer-vite@0.1.38 or laster. imagethe web page crashed due to this problem, which was fixed by adding some lines in main.js:

async viteFinal(config) {
  // ignore react plugins
  config.plugins = config.plugins.flat().filter(p => !p.name.includes('react'))
  return config
}

i didn’t use any features about mdx. but I need to ignore the react plugins, which confused me.

Link to Minimal Reproducible Example

I’ve made the reproduction with codesanbox at storybook-bug-reproduce, you can check for more info. After the demo’s lanuching, you’ll find something wrong as below in console.

detail

What version of vite are you using?

^3.1.0(latest)

System info and storybook versions

System: OS: macOS 12.5.1 CPU: (8) arm64 Apple M1 Binaries: Node: 16.16.0 - ~/.nvm/versions/node/v16.16.0/bin/node Yarn: 1.22.19 - ~/.pnpm/yarn npm: 8.11.0 - ~/.nvm/versions/node/v16.16.0/bin/npm Browsers: Chrome: 104.0.5112.101 Safari: 15.6.1 npmPackages: @storybook/addon-actions: ^6.5.10 => 6.5.10 @storybook/addon-backgrounds: ^6.5.10 => 6.5.10 @storybook/addon-docs: ^6.5.10 => 6.5.10 @storybook/addon-essentials: ^6.5.10 => 6.5.10 @storybook/addon-links: ^6.5.10 => 6.5.10 @storybook/addon-measure: ^6.5.10 => 6.5.10 @storybook/addon-outline: ^6.5.10 => 6.5.10 @storybook/builder-vite: ^0.2.2 => 0.1.36 @storybook/client-api: ^6.5.10 => 6.5.10 @storybook/client-logger: ^6.5.10 => 6.5.10 @storybook/core-common: ^6.5.10 => 6.5.10 @storybook/node-logger: ^6.5.10 => 6.5.10 @storybook/vue3: ^6.5.10 => 6.5.10

Participation

  • I am willing to submit a pull request for this issue.

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
emosheeepcommented, Sep 8, 2022

@IanVS 😄 I made some updates about the meta info of this issue, tried and succeeded to add an online example with codesandbox, which you can easily get start. Please scroll to the top of the page and see the description of the issue.

2reactions
emosheeepcommented, Aug 30, 2022

Of course. I tried to create a demo with codesandbox, but I failed, I’ll try it again later with some other ways

Read more comments on GitHub >

github_iconTop Results From Across the Web

React.createElement: type is invalid -- expected a string
If you use react-router-config make sure you use the component property instead of render , because the package doesn't support the later.
Read more >
Warning: React.jsx: type is invalid -- expected a string ...
Warning: React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: undefined.
Read more >
(React) Element type is invalid, expected a string (for built ...
To solve the error "Element type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got",...
Read more >
Invalid Hook Call Warning
There are three common reasons you might be seeing it: You might have mismatching versions of React and React DOM. You might be...
Read more >
Error React createElement type is invalid expected a string ...
I get the following error. React. · My index.js · Then in my components/App.js
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