question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Make `ssr.noExternal` shallow

See original GitHub issue

Description

Current behavior in v2: when an SSR dependency some-library is noExternal, then Vite will as well noExternal all some-library’s dependencies.

Current behavior in v3 (beta): slightly better because it only noExternal dependencies of some-libraries that cannot be resolved. (Correct me if I’m wrong.)

Suggested solution

Externalize all some-library’s dependencies. I.e. only make some-library noExternal.

Priority

Low. (Because AFAICT this doesn’t cause the same problems than noExternalize too many SSR user dependencies.)

Alternative

No response

Additional context

No response

Validations

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:12 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
brilloutcommented, Jul 8, 2022

It is the other way around. IIUC, in v2 sub-dependencies of some-library will end up being external

I just tried and it does seem to be as I described. (The VikePress dependency tweemoji is living in dist/.)

this is broken if we also don’t rewrite imports to resolved node_modules paths that may also break in prod, no?

Yes exactly, see my previous reply.

0reactions
brilloutcommented, Jul 13, 2022

It’s the reason why we split dependencies and devDependencies in the first place, so I think it’s fairly common.

I see, that makes sense.

Lock files won’t help unless vikepress is a “dependency” which npm install --prod would only then install. If it’s a “devDependency”, we can’t access twemoji even if we resolved to a deep path because it’s not installed.

Vite only needs to resolve twemoji If it occurs somewhere in the code. If it occurs somewhere in the code then it’s not a devDependency to start with.

So I still think a lock file works (as long as the package manager produces a node_modules file structure that is stable given a specific lock file).

Read more comments on GitHub >

github_iconTop Results From Across the Web

SSR Options - Vite
Force externalize dependencies for SSR. ssr.noExternal #. Type: string | RegExp | (string | RegExp)[] | true; Related: SSR Externals.
Read more >
The Structure of Scientific Revolutions
That choice, however, makes it difficult to see scientific development as a process of ... are no external standards to permit a judgment...
Read more >
US7990803B2 - Deployment and retrieval method for shallow water ...
The streamers are made to float near the water's surface. The same or other similar ... The focus of the present invention is...
Read more >
NI 43-101 Technical Report for the Seabee Gold Operation ...
The material factors or assumptions that SSR Mining identified and were applied by SSR. Mining in drawing the conclusions or making ...
Read more >
TASK 600 – HIPPS FLOWLINE VERSUS RISER BURST IN ...
The de facto result of these codes is that, in shallow and moderate water depth ... This is not the case at the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found