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

parse-ms does not work with require() #13

Open
dionsyran2 opened this issue Aug 2, 2021 · 3 comments
Open

parse-ms does not work with require() #13

dionsyran2 opened this issue Aug 2, 2021 · 3 comments

Comments

@dionsyran2
Copy link

Hello,
I realized that parse-ms cannot be included with require() As i get this error

import parseMilliseconds from 'parse-ms'
^^^^^^

SyntaxError: Cannot use import statement outside a module

Thats why i used the source code from parse-ms to create parse-ms-2, https://www.npmjs.com/package/parse-ms-2
All the source is in github (https://github.com/dionsyran2/parse-ms-2), so you can have a look and make sure i am not giving you a virus or something.

Thanks for reading

Have a nice day,
dionsyran2

@LoopyChimp
Copy link

Hey! Change require to import and i find it works just fine!

@dionsyran2
Copy link
Author

Hey! Change require to import and i find it works just fine!

only that you need to change my project to module to use import, but if i do i cannot use require or import other modules, because they only work with require()

@LoopyChimp
Copy link

hmm, sometimes it doesnt require you to have require for all of them, i changed all my requires to import. clone your files to a new folder and try that.

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

2 participants