Skip to content

Commit

Permalink
Update +Page.mdx: fix small typo (#1937)
Browse files Browse the repository at this point in the history
  • Loading branch information
redbar0n authored Oct 26, 2024
1 parent 3dcf278 commit b485c84
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/pages/broken-npm-package/+Page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ You may ask yourself how it's possible that an npm package can publish invalid J

The main reason is that some frameworks such as Next.js transpile the server-side code of npm packages, whereas Vite transpiles only the client-side code of npm packages. When server-side code contains invalid JavaScript then Node.js crashes and throws one of <Link href="#common-errors">these errors</Link>, while transpilers are more tolerant and transform invalid JavaScript (that Node.js isn't able to execute) into valid JavaScript (that Node.js is able to execute).

By default, Vite doesn't transpile the server-side code of npm packages for a much faster DX, so that Node.js directly executes the server-side code without involving a slow transpilition process.
By default, Vite doesn't transpile the server-side code of npm packages for a much faster DX, so that Node.js directly executes the server-side code without involving a slow transpilation process.

That's why <Link href="#workaround">adding an npm package to `ssr.noExternal`</Link> is usually a workaround when the npm package contains invalid JavaScript.
By adding an npm package to `ssr.noExternal`, you replicate the behavior of frameworks like Next.js.
Expand Down

0 comments on commit b485c84

Please sign in to comment.