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

Uncaught (in promise) ReferenceError: require is not defined #45

Closed
davohambardzumyan opened this issue Jan 17, 2023 · 8 comments
Closed

Comments

@davohambardzumyan
Copy link

Getting issue in console on production(npm run build).
image

@srini-leanfolks
Copy link
Contributor

srini-leanfolks commented Jan 19, 2023

I got this also. I think it is due to dayjs in production build uses require(cjs) instead of import(mjs).

@onesine help us solve this issue

@srini-leanfolks
Copy link
Contributor

srini-leanfolks commented Jan 19, 2023

I used requirejs package also via cdn. But i got other issues.

image

@davohambardzumyan
Copy link
Author

@srini-leanfolks I moved the package out of node modules and fixed this part for myself.

in index.esm.js you can replace require to import isBetween from 'dayjs/plugin/isBetween (on line 940)

and i commented switch case (on line 150)

Waiting for when will be fixed this part. :)

@haithem-rihane
Copy link

@srini-leanfolks how it gets updated in npmjs.com ?

@srini-leanfolks
Copy link
Contributor

@srini-leanfolks how it gets updated in npmjs.com ?

Sorry I didn't get you

@JefteCaro
Copy link
Collaborator

Fix in v1.4.1

Closing this issue

@gelmio
Copy link

gelmio commented Jan 30, 2023

@JefteCaro I'm still getting the same error in production builds. Using version 1.4.1. (dayjs v1.11.6)

Edit: I get it when the code hits the loadLanguageModule function, rather than the isBetween function.

@daniyal-khalil
Copy link

daniyal-khalil commented Jan 30, 2023

@gelmio facing the same issue with loadLanguageModule.

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

No branches or pull requests

6 participants