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

Server only dependencies breaking ui build #107

Closed
ericp96 opened this issue Oct 19, 2018 · 8 comments
Closed

Server only dependencies breaking ui build #107

ericp96 opened this issue Oct 19, 2018 · 8 comments

Comments

@ericp96
Copy link

ericp96 commented Oct 19, 2018

I have some dependencies that only work in node, as a result it seems to break the ui webpack build? I'm not quite sure how to repair:

app_1            | ℹ 「pawjs」: Compiled successfully.
app_1            | Error: package.json does not exist at /package.json
app_1            |     at Object.exports.find (webpack://dev-server/./node_modules/node-pre-gyp/lib/pre-binding.js?:26:11)
app_1            |     at Object.eval (webpack://dev-server/./node_modules/grpc/src/grpc_extension.js?:35:27)
app_1            |     at eval (webpack://dev-server/./node_modules/grpc/src/grpc_extension.js?:89:30)
app_1            |     at Object../node_modules/grpc/src/grpc_extension.js (<anonymous>:2187:1)
app_1            |     at __webpack_require__ (<anonymous>:30:30)
app_1            |     at Object.eval (webpack://dev-server/./node_modules/grpc/src/client_interceptors.js?:151:12)
app_1            |     at eval (webpack://dev-server/./node_modules/grpc/src/client_interceptors.js?:1596:30)
app_1            |     at Object../node_modules/grpc/src/client_interceptors.js (<anonymous>:2140:1)
app_1            |     at __webpack_require__ (<anonymous>:30:30)
app_1            |     at Object.eval (webpack://dev-server/./node_modules/grpc/src/client.js?:42:27)
app_1            | ⚠ 「pawjs」: Hash: f4756abd2aae95df45c2

Thoughts?

@tirthbodawala
Copy link
Member

@ericp96 was this issue solved?

@ericp96
Copy link
Author

ericp96 commented Oct 29, 2018

Nope, not yet. I'll try to take a deeper dive sometime soon, however between other higher priorities such as a new baby, I haven't had the time to look at it.

Any inspiration would be appreciated. I think it might have something to do with the webpack configuration needing to be different for the server so this exception is not thrown, but I'm not certain how.

@tirthbodawala
Copy link
Member

Which OS and Node versions are you using? Cause the error seems to be from node-pre-gyp which may be causing the issue.

PS: Congrats on the baby. Happy for you.

@ericp96
Copy link
Author

ericp96 commented Oct 30, 2018

Thanks, Tirth!

I'm not entirely certain what is going on here, it's definitely a build thing. I'm putting the application inside a node 10 docker image. My guess is that webpack-dev-server is trying to do a client build and can't because it's trying to do something with grpc which is a Node.js thing and not a client side thing. As a result I think it's generating the exception mentioned.

I'm guessing node-gyp is a dependency of the node.js grpc library and whatever it's invoking is an invalid API call on the client.

@santalucial
Copy link

Same issue trying to add internal api's using mongoose, webpack breaks the serverside code

@tirthbodawala
Copy link
Member

@santalucial Can you please share a demo repo or error code logs?

@santalucial
Copy link

@tirthbodawala i've tried to replicate on a different pc but it seems it can compile successfully, gonna report back next week when i get my hands back on the pc where the issue arose

@santalucial
Copy link

@tirthbodawala it appears my issue was unrelated, due to the "test" script not working(it doesn't work even without the package i added) and complaining about the dotenv package and suggesting to install another one that eventually breaks the build completely

node_modules/@pawjs/pawjs/src/scripts/cli.ts:3:20 - error TS7016: Could not find a declaration file for module 'dotenv'. 'c:/Sviluppo/react-pwa/node_modules/dotenv/lib/main.js' implicitly has an 'any' type.
Try npm install @types/dotenv if it exists or add a new declaration (.d.ts) file containing declare module 'dotenv';

3 import dotenv from 'dotenv';

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants