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

[Build] [All] v2.7.0 Error while requiring module @element-plus/nuxt: TypeError: _dayjs.default.extend is not a function #16512

Closed
trandaison opened this issue Apr 15, 2024 · 18 comments

Comments

@trandaison
Copy link

trandaison commented Apr 15, 2024

Bug Type: Build

Environment

  • Vue Version: 3.4.21
  • Element Plus Version: 2.7.0
  • Browser / OS: macOS 14.0
  • Build Tool: Nuxt

Reproduction

https://codesandbox.io/p/devbox/wonderful-elion-wm8dqg?file=%2Fpackage.json%3A8%2C33 (thanks @haozileung)

Related Component

  • All

Reproduction Link

Link

Steps to reproduce

Update an existing element plus to v2.7.0

What is Expected?

Installation should be success.

What is actually happening?

Screenshot 2024-04-15 at 09 44 01

Log

> nuxt prepare


[9:29:49 AM]  ERROR  Error while requiring module @element-plus/nuxt: TypeError: _dayjs.default.extend is not a function


 ERROR  _dayjs.default.extend is not a function                         9:29:49 AM

  at node_modules/element-plus/es/components/time-picker/src/time-picker.mjs:10:16
  at evalModule (node_modules/jiti/dist/jiti.js:1:256443)
  at jiti (node_modules/jiti/dist/jiti.js:1:254371)
  at node_modules/element-plus/es/components/time-picker/index.mjs:1:2184
  at evalModule (node_modules/jiti/dist/jiti.js:1:256443)
  at jiti (node_modules/jiti/dist/jiti.js:1:254371)
  at node_modules/element-plus/es/components/calendar/src/date-table.mjs:2:1
  at evalModule (node_modules/jiti/dist/jiti.js:1:256443)
  at jiti (node_modules/jiti/dist/jiti.js:1:254371)
  at node_modules/element-plus/es/components/calendar/src/date-table2.mjs:3:18



 ERROR  _dayjs.default.extend is not a function                         9:29:49 AM

 ELIFECYCLE  Command failed with exit code 1.

Additional comments

There was an issue on element-plus-nuxt repo element-plus/element-plus-nuxt#95, however, the lasted of @element-plus/nuxt v1.0.8 and element-plus v2.6.3 is still working, I think the problem should be in element-plus 2.7.0 it self.

@btea
Copy link
Collaborator

btea commented Apr 15, 2024

Can you provide a simple repository reproduction link?

@iBobik
Copy link

iBobik commented Apr 15, 2024

Downgrade helped:

npm i -D @element-plus/nuxt@=1.0.8 element-plus@=2.6.3

@btea
Copy link
Collaborator

btea commented Apr 16, 2024

@haozileung According to the online link you provided, there is indeed an error. However, when I downloaded it and ran it locally, it seemed normal.

Could it be related to the environment? My local system is win10 and the node version is 18.19.1.

image

@HaManhCuong-2910
Copy link

I have same issue when build nuxt in Ubuntu, can you try it in Ubuntu environment?

@trandaison
Copy link
Author

@HaManhCuong-2910 Chưa cần thiết dùng các tính năng của 2.7.0 thì ông hạ xuống 2.6.3 xài tạm đi đã, trong khi chờ issue được fix.

@HaManhCuong-2910
Copy link

@HaManhCuong-2910 Chưa cần thiết dùng các tính năng của 2.7.0 thì ông hạ xuống 2.6.3 xài tạm đi đã, trong khi chờ issue được fix.
Tôi hạ xuống 2.6.3 r mà vẫn dính lỗi đấy :))

@HaManhCuong-2910
Copy link

@HaManhCuong-2910 Chưa cần thiết dùng các tính năng của 2.7.0 thì ông hạ xuống 2.6.3 xài tạm đi đã, trong khi chờ issue được fix.

Ông fix được chưa

@trandaison
Copy link
Author

trandaison commented Apr 16, 2024

@HaManhCuong-2910 tui xài 2.6.3 bình thường.

Screenshot 2024-04-16 at 08 58 19

@HaManhCuong-2910
Copy link

@trandaison Ông build dùng nuxt generate à hay là nuxt build

@damtrongan
Copy link

Downgrade helped:

npm i -D @element-plus/nuxt@=1.0.8 element-plus@=2.6.3

I tried this workaround and applied it to Docker file. It worked for me.

@HaManhCuong-2910
Copy link

@damtrongan Which node image do you use in Dockerfile?

@damtrongan
Copy link

node:18.16-alpine3.17

@HaManhCuong-2910
Copy link

@damtrongan Are you andt02? =)))

@damtrongan
Copy link

=))) right

@HaManhCuong-2910
Copy link

@damtrongan I did see your commit "update Dockerfile" in my project =)))

@tolking
Copy link
Member

tolking commented Apr 20, 2024

Fixed with @element-plus/nuxt to v1.0.9.

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

此 issue 已被自动锁定,因为关闭后没有任何近期活动。如果有相关 bug,请重新创建一个新 issue。

@github-actions github-actions bot locked and limited conversation to collaborators May 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants