Skip to content
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

Error in using Element-ui without client-only tag #348

Open
suary opened this issue May 18, 2022 · 2 comments
Open

Error in using Element-ui without client-only tag #348

suary opened this issue May 18, 2022 · 2 comments

Comments

@suary
Copy link

suary commented May 18, 2022

Environment

- Operating System: `Darwin`
- Node Version:     `v16.15.0`
- Nuxt Version:     `2.16.0-27358576.777a4b7f`
- Package Manager:  `[email protected]`
- Builder:          `webpack`
- User Config:      `render`, `css`, `plugins`, `build`, `alias`, `bridge`, `buildModules`
- Runtime Modules:  `-`
- Build Modules:    `@nuxt/[email protected]`

Reproduction

sandbox
please download code and run yarn buildstart or run nuxi build and nuxi preview

Describe the bug

When I use element-ui plugin without client mode:

if I run nuxi build && nuxi preview ,after I open localhost:3000 Terminal will throw error:
[nuxt] [request error] document is not defined at Object.<anonymous> (./.output/server/node_modules/element-ui/lib/utils/types.js:39:165) at Module._compile (node:internal/modules/cjs/loader:1105:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10) at Module.load (node:internal/modules/cjs/loader:981:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12) at Module.require (node:internal/modules/cjs/loader:1005:19) at require (node:internal/modules/cjs/helpers:102:18) at Object.<anonymous> (./.output/server/node_modules/element-ui/lib/utils/util.js:19:14) at Module._compile (node:internal/modules/cjs/loader:1105:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)

nuxi dev is ok

And when I use element-ui plugin in client mode,I need to put all element-ui component in client-only tag , but in Nuxt2 , I can use it without client mode ,all element-ui components I have Used supports ssr good in Nuxt2

Additional context

why it's ok in nuxi dev but throw error in nuxi preview?

Logs

No response

@Ttou
Copy link

Ttou commented Feb 5, 2024

same issue

@Ttou
Copy link

Ttou commented Feb 5, 2024

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

No branches or pull requests

2 participants