lmaccherone / node-localstorage

A drop-in substitute for the browser native localStorage API that runs on node.js.
MIT License
450 stars 36 forks source link

es6 dynamic import is not supported #21

Closed 5punk closed 6 years ago

5punk commented 8 years ago

I am writing an isomorphic app, which doesn't allow conditional imports.

If i go ahead and import it anyway I get an error

graceful-fs.js: Uncaught TypeError: Cannot read property 'prototype' of undefined

Any help?

lmaccherone commented 8 years ago

No sure how to deal with that. Are there other packages that you know of that work in both places without conditional imports? Maybe I could sense if window.LocalStorage already existed and if so, return that in my constructor. Can you modify it and try that to see if that works?

edrpls commented 8 years ago

Sorry for digging this up, but I am using it like this with no errors:

import { LocalStorage } from 'node-localstorage';