We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Thank you for such a great project.
I noticed that importing some react libraries fails with such errors:
Uncaught TypeError: Cannot read properties of null (reading 'useState')
I tried these code snippets (from official websites of packages) in the playground and they give the same errors
import React from 'https://esm.sh/react' import { Tldraw } from 'https://esm.sh/tldraw' // import 'tldraw/tldraw.css' export default function () { return <Tldraw /> }
import React from 'https://esm.sh/react'; import { ReactFlow } from 'https://esm.sh/@xyflow/react'; // import '@xyflow/react/dist/style.css'; const initialNodes = [ { id: '1', position: { x: 0, y: 0 }, data: { label: '1' } }, { id: '2', position: { x: 0, y: 100 }, data: { label: '2' } }, ]; const initialEdges = [{ id: 'e1-2', source: '1', target: '2' }]; export default function App() { return ( <div style={{ width: '100vw', height: '100vh' }}> <ReactFlow nodes={initialNodes} edges={initialEdges} /> </div> ); }
The text was updated successfully, but these errors were encountered:
The problem was importing multiple instances of react.
this can be fixed by specifying dependencies as external, e.g.: import { Tldraw } from 'https://esm.sh/tldraw?external=react,react-dom'
import { Tldraw } from 'https://esm.sh/tldraw?external=react,react-dom'
Sorry, something went wrong.
No branches or pull requests
Thank you for such a great project.
I noticed that importing some react libraries fails with such errors:
Examples for failing modules
I tried these code snippets (from official websites of packages) in the playground and they give the same errors
Additional info
The text was updated successfully, but these errors were encountered: