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

Unable to import from Vue #144

Closed
cjpearson opened this issue Jul 15, 2024 · 1 comment · Fixed by #145
Closed

Unable to import from Vue #144

cjpearson opened this issue Jul 15, 2024 · 1 comment · Fixed by #145
Assignees

Comments

@cjpearson
Copy link

I was trying out the fix for #139 and while it does resolve the issue with vue/server-renderer, it's also uncovered some issues with other imports from vue.

Expected Behavior

Applications which import functions from vue will work fine when the import-in-the-middle hook is loaded.

Actual Behavior

I get the following error when running a script which imports from vue.

SyntaxError: The requested module 'vue' does not provide an export named 'ref'
    at ModuleJob._instantiate (node:internal/modules/esm/module_job:131:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:213:5)
    at async ModuleLoader.import (node:internal/modules/esm/loader:316:24)
    at async loadESM (node:internal/process/esm_loader:34:7)
    at async handleMainPromise (node:internal/modules/run_main:66:12)

Node.js v20.9.0

Steps to Reproduce the Problem

  1. Create index.mjs
import { ref } from 'vue'

console.log('hello world')
  1. Run with node --loader=import-in-the-middle/hook.mjs index.mjs

Specifications

  • Version: 1.9.1
  • Platform: MacOS
  • Subsystem:
@timfish
Copy link
Contributor

timfish commented Jul 23, 2024

A fix for this has been released in v1.10.0

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 a pull request may close this issue.

2 participants