-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
ref(nextjs): Use resolved paths for require
calls in config code
#3426
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
ref(nextjs): Use resolved paths for require
calls in config code
#3426
Conversation
size-limit report
|
Will this not still expect everything to live at the project's ideally it would just replicate npm's resolver code to find the other module |
@dcramer - fair point. As it turns out to be more complicated than one might like, I'm going to outsource the task. |
this is super off topic, but something we might want to consider.. given complexity of vulnerabiltiies/deps in sdks. what if we vendored third party deps? im assuming (and praying) we have very few, and it'd make everyone more comfortable knowing the dep graph isnt 1000+ random npm modules that might change under the hood and cause customers more security vetting |
@dcramer It's funny you should say that... The library I linked above turns out to be non-ESM compliant ( |
@lobsterkatie ,Will using resolve-package-path as you mentioned help in getting the package location in a yarn-workspace setup where the packages are hoisted?
|
87b00ed
to
8465659
Compare
8465659
to
79ca864
Compare
@Tevinthuku Yes, I believe it should, though I didn't end up using that library, as it's broken for ESM builds (see my note above), and vendoring it turned out to be more trouble than it was worth. Once this is merged and released, which should be in the next few days, please let me know if you're still having trouble. |
Can we also fix this: #3441 ? |
I think #3444 fixes only part of #3441 - it will stop sentry problems from turning into breaking-the-world problems, but it doesn't address the read-only nature of the vercel filesystem. In other words, we won't crash people's apps, but the plugin won't work, either. Still I think it's a good thing to do, and we can address the read-only part in a separate PR. |
I got to test the new release of the plugin & Im getting this error, This line is the culprit,
I tried commenting it out locally to see what happens & the same error occurs, but now on the |
@Tevinthuku -Thanks. Can you please file an issue with pretty much exactly what you have in your comment? I'll work on a fix in the meantime. |
Sure thing. |
Currently, we use relative paths for the
require
calls insyncPluginVersionWithNextVersion
. Though this works most of the time, it depends on the particular structure of the user'snode_modules
directory, which is mostly predictable but not guaranteed. This PR therefore switches to using a combination ofrequire.resolve
and a recursive search up the file hierarchy to find thepackage.json
files we need.Fixes #3424.
Fixes #3430.