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
fix: resolve addons using nodeResolve() #5809
Conversation
@ygj6 nice! Do you know why this was a regression? I don't see many places in the code where we are checking for About the test case, I'm thinking that we may want to create a new vanilla |
@patak-js I think this is because
Good idea! I can issue a new PR for this test case. |
Prisme generates the |
On further inspection, Prisma problem is also related to |
Here's a repro: https://github.com/cyco130/vite-ssr-http-common-issue
|
@cyco130 I tested it locally with the latest code, it is a separate issue, thanks for your help! |
I'm sure that the problem lies here. https://github.com/vitejs/vite/blob/main/packages/vite/src/node/plugins/importAnalysis.ts#L370 This condition is not working properly because filtering is performed in the source code of https://github.com/sindresorhus/builtin-modules/blob/main/index.js#L10 I don’t know the reason for this, can you take a look? @patak-js |
Opened an issue with an explanation of the possible cause: #5826 |
I checked |
There was a similar issue against esbuild evanw/esbuild#1294 esbuild is maintaining a harcoded list, should we do the same? // This list can be obtained with the following command:
//
// node --experimental-wasi-unstable-preview1 -p "[...require('module').builtinModules].join('\n')"
//
// Be sure to use the *LATEST* version of node when updating this list! |
I wanted to replace it by calling from node's provided
I'm not sure why, it could be an unintentional safeguard.
I think that sounds like a good plan 👍 |
@ygj6 what do you think? We are using esbuild anyways, so we will have issues because of their list if we don't do the same. The ideal would be that this is shared somehow, but I think we could hardcode now and check hot to make this more robust later. |
@patak-js
I agree with that, this seems to be a more feasible way at the moment.
Anything can promote this? |
I don't think that Evan Wallace would like to expose an API for us to get this info, looks that it is out of scope for esbuild. Maybe the best would be to fix |
I think @bluwy has done some investigations in our previous discussion #5248 (comment), right? |
Yeah, |
Description
fix: #5709
Passed the test using the
bcrypt
module, but did not test the@prisma/client
module mentioned in #5709 because I don't have a clue about the example of using this module. Can you provide further help like another replication repo? @cyco130Additional context
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).