-
-
Notifications
You must be signed in to change notification settings - Fork 375
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
Build can't find node_module ending in .js or starting with @ #310
Comments
How do you import your module? Could you generate a simply reproduce repo so I can clone and play with it? |
Hi @thangngoc89 I import it the "regular" way: I just now noticed it also fails when I import an organization package like I'll create a repo for you. I'll post a comment here with a link when it's done 🙂 |
that's weird. I'll take a look. btw, I usually use https://github.com/KyleAMathews/react-headroom . it's super small with declarative API |
Yeah I just changed to that one (it misses some of the options however) 🙂 I've uploaded a small demo on https://github.com/rijkvanzanten/preact-cli-import-demo It is the default |
This looks like a bug in ours' implementation. Investigating it |
@rijkvanzanten does it work fine when you pass a flag |
@reznord it doesn't work in dev mode too. |
@reznord the no prerender flag doesn’t change anything |
no pre-render does fix it for me btw. Having this issue with Stack trace:
|
I'm seeing it work without prerendering, so this makes me thinks it's related to our use of |
It failed for me when I tried with |
ah it might just be dev vs prod. dev build (watch) worked for me |
I just wanted to mention that this happens for me too. If you are trying to add |
As @developit mentioned earlier, it is because of the SSR build that we are shipping by default. We will be providing a better error stack trace when it fails on this in the future. |
Do you want to request a feature or report a bug?
Report a bug
What is the current behavior?
Trying to production build an app which uses a Node module which ends in
.js
(likeheadroom.js
) results in aENOENT
errorIf the current behavior is a bug, please provide the steps to reproduce.
Import a Node module ending in
.js
into your Preact appWhat is the expected behavior?
It should require the module from
node_modules/headroom.js
Please mention other relevant information.
The text was updated successfully, but these errors were encountered: