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

chore: enable importing module in node #98

Merged
merged 1 commit into from Sep 5, 2021

Conversation

danielroe
Copy link
Contributor

This line was originally added by #70 (at which point there were no mjs/cjs files).

Now that there are, this line is now preventing importing the .mjs file from within a module context in node.

The error generated is:

import { isRef, ref, watchEffect, computed, customRef, unref, inject, watch, getCurrentInstance, onMounted, onUpdated, shallowRef, getCurrentScope, reactive, markRaw, readonly, onBeforeUpdate, isVue2 } from 'vue-demi';
                ^^^
SyntaxError: Named export 'ref' not found. The requested module 'vue-demi' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from 'vue-demi';
const { isRef, ref, watchEffect, computed, customRef, unref, inject, watch, getCurrentInstance, onMounted, onUpdated, shallowRef, getCurrentScope, reactive, markRaw, readonly, onBeforeUpdate, isVue2 } = pkg;

@antfu antfu merged commit 41ec3fd into vueuse:master Sep 5, 2021
@danielroe danielroe deleted the chore/fix-node-mjs branch September 5, 2021 18:42
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

Successfully merging this pull request may close these issues.

None yet

2 participants