-
Notifications
You must be signed in to change notification settings - Fork 293
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
npm package optional
doesn't work on next-server
#399
Comments
Just to add on, when this package gets transpiled, it ends up looking like this: /* 9297 */
/***/ (function(module) {
module.exports = function(module, options){
try{
if(module[0] in {".":1}){
module = process.cwd() + module.substr(1);
}
return require(module);
}catch(err){
if (err.code !== "MODULE_NOT_FOUND" && options && options.rethrow) {
throw err;
}
}
return null;
};
/***/ }). Note, require isn't a |
Ideally, i'd like to specify that these two packages should be copied to the build in a node_modules directory? |
Potentially solved by upgrading ncc to 0.19 |
I tested
This prints the Can you provide steps to reproduce this issue? |
Might potentially be a typescript specific issue. Reproducible repository here: https://github.com/aequasi/typescript-ncc-optional-bug-report |
@aequasi I get an error that You need to run
This does not appear to be a bug with |
Please do not close this. Give me a minute to reply. |
Heres the |
Correct. But Please try running your code without |
Hmmm. that did change it. Perhaps there is something noticeable and reproducible here: https://github.com/secretary/api Getting the same error as #377. While digging into the generated error, it led me to this optional package. If I alter the transpiled code, and |
I tried the following:
Then I get a
Is this what you are seeing? |
No, sorry. forgot to remove some dependencies. Was connecting to external services. Removed that logic. I get this:
then hit: http://localhost:3000/graphql |
It worked for me. Steps
Output
WebVisiting http://localhost:3000/graphql looks like this: |
Do you still get this with |
It didn't work with But when I deploy I get a similar error to #377
|
Found a problem while using nestjs. They have some stuff using the
optional
package, and it doesn't get transpiled properly by webpackMade an issue over on their repo too:
nestjs/nest#2213
The text was updated successfully, but these errors were encountered: