Skip to content
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 does not work on Zeit's now platform #2213

Closed
cryptiklemur opened this issue May 16, 2019 · 3 comments
Closed

npm package optional does not work on Zeit's now platform #2213

cryptiklemur opened this issue May 16, 2019 · 3 comments

Comments

@cryptiklemur
Copy link

cryptiklemur commented May 16, 2019

I'm submitting a...


[ ] Regression 
[x] Bug report
[x] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.

Current behavior

When building a nestjs application on Zeit Now v2, anything that uses require('optional') doesn't work properly.

Due to how the builders work, require never gets transpiled into a webpack compatible require (e.g. __webpack_require__(7394)), so the package isnt found, and optional('type-graphql') (for example) always returns null

Expected behavior

Avoid using the optional package

Minimal reproduction of the problem with instructions

Spin up a zeit now v2 app, using the node-server builder, with now dev

@cryptiklemur
Copy link
Author

Problem stems from optional not allowing for static analysis, and not being included in a webpack build

@kamilmysliwiec
Copy link
Member

Let's track this here #3035

@lock
Copy link

lock bot commented Dec 26, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Dec 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants