-
Notifications
You must be signed in to change notification settings - Fork 20
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
Use classes do not allow for paths outside of current folder #114
Comments
yes. you're probably right. the use classes now follow the nodejs require semantic. if the name doesn't start with a another possibility could be to add the @struct78 any chance our source code is public? |
@tripodsan Unfortunately not. I'll try and make a public repo with some sample code if I get the time. |
@tripodsan Here is some sample code that closely matches our setup https://github.com/struct78/htlengine-issue-114 |
thanks, I will look into it as soon as I have time.... |
ok, I see the problem. you are using the |
nodejs 10.12 added: https://nodejs.org/docs/latest-v10.x/api/modules.html#modules_module_createrequirefrompath_filename which would be an easy way to add the |
🎉 This issue has been resolved in version 3.3.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
A couple of things:
I think the update from 3.2.7 to 3.2.8 should have had a major version bump.
We have our project structure set up in a way that mimics the use of Java classes. For example, we have a simple file loader that outputs SVG code inline so it can be styled.
We then used the
withUseDirectory
method of the runtime to load modules from the 'modules/' folder in the root e.g.So this sits in
src/modules/com.companyname.project.InlineSvgUtility.js
, and was working happily. In 3.2.8 the withUseDirectory seems to effectively do nothing.This line seems to be the cause.
6d00698#diff-59e501da46af5081071db46e7c50a748R243
If the path doesn't start with './' (e.g. '../'), it will attempt to resolve files relative to the folder the Compiler script is in, rather than the baseDir. For example, this will throw a "MODULE_NOT_FOUND" error.
I can fix it by traversing up 6 or so folders out of the node_modules, but that's not ideal.
The text was updated successfully, but these errors were encountered: