You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying to use Vue with Vue Router as a module, as indicated in Vue 3 Quick Start
So I installed them with npm i vue and npm i vue-router and imported them directly to html page via importmap. Import of /node_modules/@vue/devtools-api/lib/esm/index.js itself will work, but imports and exports in index.js will fail, as they depends on Node module resolution algorithm, ability to complete filenames by adding missing extensions.
The Vue and Vue Router will work in browser directly, as modules, without build tools use, as suggested in Vue 3 Quick Start - usage with script type importmap.
What is actually happening?
All modules imports and exports mentioned in js/ts files in @vue/devtools-api/lib/esm/ will fail in browser, as all these imports and exports relies on Node's module resolution algorithm.
Just remove this dependency adding correct filename extensions. For example, @vue/devtools-api/lib/esm/index.js starts with these rows:
import { getTarget, getDevtoolsGlobalHook, isProxyAvailable } from './env';
import { HOOK_SETUP } from './const';
import { ApiProxy } from './proxy';
export * from './api';
export * from './plugin';
export * from './time';
Just add correct extensions or /index.js as below:
import { getTarget, getDevtoolsGlobalHook, isProxyAvailable } from './env.js';
import { HOOK_SETUP } from './const.js';
import { ApiProxy } from './proxy.js';
export * from './api/index.js';
export * from './plugin.js';
export * from './time.js';
And repeat for all files in esm folder. And Devtools and Vue Router will start work as expected.
The text was updated successfully, but these errors were encountered:
ghost
changed the title
Devtools-api depends on Node's module resolution ability as explained below.
@vue/evtools-api depends on Node's module resolution ability
Apr 20, 2022
ghost
changed the title
@vue/evtools-api depends on Node's module resolution ability
@vue/devtools-api depends on Node's module resolution ability
Apr 23, 2022
Uh oh!
There was an error while loading. Please reload this page.
6.1.4
Browser and OS info
any
Steps to reproduce
Trying to use Vue with Vue Router as a module, as indicated in Vue 3 Quick Start
So I installed them with
npm i vue
andnpm i vue-router
and imported them directly to html page via importmap. Import of /node_modules/@vue/devtools-api/lib/esm/index.js itself will work, but imports and exports in index.js will fail, as they depends on Node module resolution algorithm, ability to complete filenames by adding missing extensions.What is expected?
The Vue and Vue Router will work in browser directly, as modules, without build tools use, as suggested in Vue 3 Quick Start - usage with script type importmap.
What is actually happening?
All modules imports and exports mentioned in js/ts files in @vue/devtools-api/lib/esm/ will fail in browser, as all these imports and exports relies on Node's module resolution algorithm.
Just remove this dependency adding correct filename extensions. For example, @vue/devtools-api/lib/esm/index.js starts with these rows:
Just add correct extensions or /index.js as below:
And repeat for all files in esm folder. And Devtools and Vue Router will start work as expected.
The text was updated successfully, but these errors were encountered: