Comments (7)
Why not just use
import { AceBase } from 'acebase';
from acebase.
import { AceBase } from 'acebase';
^^^^^^^
SyntaxError: The requested module 'acebase' is expected to be of type CommonJS, which does not support named exports. CommonJS modules can
be imported by importing the default export.
For example:
import pkg from 'acebase';
const { AceBase } = pkg;
from acebase.
This is using "type": "module",
in package.json
from acebase.
I'm not able to reproduce?
If I set "type": "module"
in my test package.json, I am able to use import { AceBase } from 'acebase';
without getting an error.
What node version are your using? I just tested with v14.15.4
from acebase.
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?
from acebase.
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: #13
from acebase.
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"! 😄
from acebase.
Related Issues (20)
- value event not returning existing data when path contains wildcards/variables HOT 2
- DEBUG THIS: getNodeInfo error Error: Invalid child key HOT 4
- pm2 cluster detection HOT 1
- import {} does not work with this package. HOT 3
- Getting feature not supported error when attempting to run in Electron app HOT 5
- When using "mutations" with a subscription it's throwing a warning HOT 5
- Unhandled Error but when i restarted the db the errors gone HOT 10
- Special chars in path corrupt data HOT 1
- Browser Acebase broke after last update HOT 2
- Schema validation fails for updates on higher path HOT 1
- Can't import { AceBase } with moduleResolution="nodenext" in tsconfig.json HOT 1
- Multiple TypeScript errors when using package acebase HOT 3
- Live query and indexing HOT 8
- `ref().get()` works while `query().get()` returns an empty array HOT 1
- Removing a large dataset throws RangeError HOT 1
- filter on nested data and IN operator for string type
- TypeError when trying to add new records after removing old ones HOT 1
- Any plan yo add Dart/Flutter support
- Error: DEV: Applied tree fixes did not change 88 pending operation(s) failing to execute HOT 1
- MySQL back-end & sync HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from acebase.