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

Dependencies with momentjs as peer deps crash on serve #3470

Closed
6 tasks done
Nfinished opened this issue May 19, 2021 · 2 comments
Closed
6 tasks done

Dependencies with momentjs as peer deps crash on serve #3470

Nfinished opened this issue May 19, 2021 · 2 comments

Comments

@Nfinished
Copy link

Describe the bug

Consumers of momentjs are failing to serve because of its wonky export. However, they build just fine.

Reproduction

Serving with a react-dates dependency fails with the following console warning:

Uncaught TypeError: (0 , _moment.default) is not a function
    at node_modules/react-dates/lib/components/CalendarDay.js

I'd assume this relates to #1724 or #2874

https://github.com/Nfinished/react-date-error-example

System Info

Output of npx envinfo --system --npmPackages vite,@vitejs/plugin-vue --binaries --browsers:

System:
    OS: macOS 11.2.1
    CPU: (8) x64 Intel(R) Core(TM) i7-8569U CPU @ 2.80GHz
    Memory: 131.59 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 14.12.0 - ~/.nvm/versions/node/v14.12.0/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 7.5.4 - ~/.nvm/versions/node/v14.12.0/bin/npm
  Browsers:
    Chrome: 90.0.4430.212
    Safari: 14.0.3
  npmPackages:
    vite: ^2.3.3 => 2.3.3

Used package manager: yarn

Before submitting the issue, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the docs.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Provide a description in this issue that describes the bug.
  • Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/vue-next instead.
  • Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
@patak-dev
Copy link
Member

@Nfinished the error you were seeing in vite 2.3.3 looks fixed in 2.4.3. Would you try to create a setup with it? I still don't see the component rendering correctly, maybe there is a missing CSS import?

@patak-dev
Copy link
Member

I'll close this one because the described bug is solved, but feel free to open a new one against the latest version if there are other issues.

@github-actions github-actions bot locked and limited conversation to collaborators Aug 10, 2021
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

2 participants