-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Dynamic require of "path" is not supported when using imports in custom jsx factory #3323
Comments
You don't have to bundle jsdom in your server side code, use
Yes, as long as you have imported this function before writing the JSX elements: import {jsx} from 'hydro'
var a = <div /> // will be compiled to jsx("div", null) This is so-called "classic" JSX, where there's also an "automatic" JSX runtime that adds those import statements automatically. The automatic one also has different design on what params are passed to the factory function. You can read more in the JSX section in the docs. |
@hyrious thank you for your help i added do you think i should make any other changes? i have it set up this way so i don't have to import |
i am trying to use my own custom jsx factory
i had it working, but now when i try and import another library, i get this error:
here is my
build.js
script:here is how i run it via
package.json
scripts:just fyi,
hydro
is the name of a symlinked custom package im working onhere is my factory function inside
jsx.js
:if i remove JSDOM entirely, it works again, eg:
but i need JSDOM to work because i can't use
document
in node contexthow do i make my custom jsx factory work with its own imports etc.?
also, am i configuring the custom jsx factory correctly here?
The text was updated successfully, but these errors were encountered: