mirror of
https://github.com/appy-one/acebase.git
synced 2026-05-25 14:12:14 -06:00
[GH-ISSUE #17] Enable es6 import in Node.js #15
Labels
No labels
IndexedDB
browser
bug
dependencies
documentation
duplicate
enhancement
feature request
indexes
indexes
invalid
pull-request
query
question
transaction logging
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/acebase#15
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @clibu on GitHub (Mar 4, 2021).
Original GitHub issue: https://github.com/appy-one/acebase/issues/17
I'm writing all my Node.js code using es6 import's however AceBase currently needs the following hack for import to work.
@appy-one commented on GitHub (Mar 4, 2021):
Why not just use
@clibu commented on GitHub (Mar 4, 2021):
@clibu commented on GitHub (Mar 4, 2021):
This is using
"type": "module",in package.json@appy-one commented on GitHub (Mar 4, 2021):
I'm not able to reproduce?
If I set
"type": "module"in my test package.json, I am able to useimport { AceBase } from 'acebase';without getting an error.What node version are your using? I just tested with v14.15.4
@appy-one commented on GitHub (Mar 4, 2021):
Apparently this is possible since Node v14.13.0, see this tweet, or this blog post about it: Node.js now supports named imports from CommonJS modules, but what does that mean?
@clibu commented on GitHub (Mar 4, 2021):
I am using 14.7.0 which works fine with es6 modules. I've just updated to 15.11.0 and import works now.
Whether you want to try and support older versions of Node is a question for you.😀
Did you notice my discussion post: https://github.com/appy-one/acebase/discussions/13
@appy-one commented on GitHub (Mar 4, 2021):
Sorry, didn't see the discussion earlier. Somehow the GitHub notification emails are not always getting through...
AceBase supports older Node versions, I haven't checked it but should at least be compatible back to version 7. If I switch to using ES modules, that would mean dropping support for older Node versions. And with the Node team already having fixed mixing CommonJS / ES modules, I'd say "don't fix it if it ain't broken"! 😄