-
-
Notifications
You must be signed in to change notification settings - Fork 34
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
Relative path resolution for require does not work #2
Comments
Btw.: if I require the renderer.js file via script:src tag then I have to use |
works for me: use |
@juliangruber he wasn't talking about using the Relative paths don't work when requiring a module which is not being served from a js file which is. I am currently facing the same problem. It would be great if someone could come up with a solution which doesn't involve resolving the path of the external module as I don't think that would work in production. |
@IssueHunt has funded $40.00 to this issue.
|
Please help. This require thing doesnt work for me too. |
Hi y'all, https://stackoverflow.com/a/55908510/9034699 I tested with electron-quick-start and I was able to get |
I may not have the solution, but some information for people who have the problem of the The problem is, that relative require can apparently only be used in files that are required themselves. So to fix that, you can actually use If typescript is used and |
Thanks for this great project, this has been very helpful! I've run into a similar issue with path resolution when calling Is this supported, or do you know of a workaround? |
When I use electron-serve in electron-quick-start
require('./renderer.js')
can't be resolved.I have to use
path.resolve
within therequire
call to make that work:Any way that can be fixed so that relative
require
s work with electron-serve?The text was updated successfully, but these errors were encountered: