Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

docs(shared): explain why Vue/Nitro imports are restricted#34799

Open
aymenhmaidiwastaken wants to merge 1 commit intonuxt:mainnuxt/nuxt:mainfrom
aymenhmaidiwastaken:docs/explain-shared-import-restrictionaymenhmaidiwastaken/nuxt:docs/explain-shared-import-restrictionCopy head branch name to clipboard
Open

docs(shared): explain why Vue/Nitro imports are restricted#34799
aymenhmaidiwastaken wants to merge 1 commit intonuxt:mainnuxt/nuxt:mainfrom
aymenhmaidiwastaken:docs/explain-shared-import-restrictionaymenhmaidiwastaken/nuxt:docs/explain-shared-import-restrictionCopy head branch name to clipboard

Conversation

@aymenhmaidiwastaken
Copy link
Copy Markdown

Summary

  • Added a clear explanation for why the shared/ directory cannot import Vue or Nitro code
  • The current docs state the restriction but don't explain the reasoning, which can lead users to ignore the warning

The explanation covers:

  • Separate build bundles with different runtime targets (browser vs Node.js/edge)
  • Incompatible dependencies and broken tree-shaking
  • Missing runtime contexts (Vue reactivity system vs server-only APIs)
  • Recommendation to use shared/ only for pure, environment-agnostic code

Closes #30862

Add a clear explanation for why the shared/ directory cannot import Vue
or Nitro code: separate build bundles, incompatible runtime environments,
broken tree-shaking, and missing runtime contexts.

Closes nuxt#30862
@bolt-new-by-stackblitz
Copy link
Copy Markdown

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@coderabbitai

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs: add reason for why you should never import Vue app code in your nitro code

1 participant

Morty Proxy This is a proxified and sanitized view of the page, visit original site.