Skip to content
This repository has been archived by the owner on Oct 28, 2022. It is now read-only.

vite support #4

Open
transtone opened this issue Apr 6, 2021 · 4 comments
Open

vite support #4

transtone opened this issue Apr 6, 2021 · 4 comments

Comments

@transtone
Copy link

transtone commented Apr 6, 2021

can't work in vite.

 [vite] Internal server error: Failed to resolve entry for package "@nopr3d/vue-next-rx". 
The package may have incorrect main/module/exports specified in its package.json.
node_modules/vite/dist/node/chunks/dep-66eb515d.js:32070:14: error: [vite:dep-scan] Failed to resolve entry for package "@nopr3d/vue-next-rx". The package may have incorrect main/module/exports specified in its package.json.
    32070 │         throw new Error(`Failed to resolve entry for package "${id}". ` +
          ╵               ^
    at resolvePackageEntry (D:\code\FE\pc-grid\node_modules\vite\dist\node\chunks\dep-66eb515d.js:32070:15)
    at tryNodeResolve (D:\code\FE\pc-grid\node_modules\vite\dist\node\chunks\dep-66eb515d.js:31907:11)
    at Context.resolveId (D:\code\FE\pc-grid\node_modules\vite\dist\node\chunks\dep-66eb515d.js:31790:28)
    at Object.resolveId (D:\code\FE\pc-grid\node_modules\vite\dist\node\chunks\dep-66eb515d.js:43659:55)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async resolve (D:\code\FE\pc-grid\node_modules\vite\dist\node\chunks\dep-66eb515d.js:43862:26)
    at async D:\code\hnrr\FE\pc-grid\node_modules\vite\dist\node\chunks\dep-66eb515d.js:43966:34
    at async callback (D:\code\FE\pc-grid\node_modules\esbuild\lib\main.js:724:28)
    at async handleRequest (D:\code\FE\pc-grid\node_modules\esbuild\lib\main.js:595:30)

   node_modules/vite/dist/node/chunks/dep-66eb515d.js:43956:18: note: This error came from the "onResolve" callback registered here
    43956 │             build.onResolve({
          ╵                   ~~~~~~~~~
    at setup (D:\code\FE\pc-grid\node_modules\vite\dist\node\chunks\dep-66eb515d.js:43956:19)
    at handlePlugins (D:\code\FE\pc-grid\node_modules\esbuild\lib\main.js:686:7)
    at Object.buildOrServe (D:\code\FE\pc-grid\node_modules\esbuild\lib\main.js:903:44)
    at D:\code\FE\pc-grid\node_modules\esbuild\lib\main.js:1444:17
    at new Promise (<anonymous>)
    at Object.build (D:\code\FE\pc-grid\node_modules\esbuild\lib\main.js:1443:14)
    at Object.build (D:\code\FE\pc-grid\node_modules\esbuild\lib\main.js:1334:51)
    at D:\code\FE\pc-grid\node_modules\vite\dist\node\chunks\dep-66eb515d.js:43816:54
    at Array.map (<anonymous>)

   src/main.js:7:18: note: The plugin "vite:dep-scan" was triggered by this import
        7 │ import VueRx from "@nopr3d/vue-next-rx"~~~~~~~~~~~~~~~~~~~~~
@transtone
Copy link
Author

It can't import the default package.
In vite, it must use

import VueRx from "@nopr3d/vue-next-rx/dist/vue-next-rx"
app.use(VueRx)

and import rxjs observable with:

import { merge } from 'rxjs/internal/observable/merge'

@NOPROD
Copy link
Member

NOPROD commented Apr 8, 2021

Hi, you closed the issue so it's done?

Else if you had an repo for example i can take a look

@webrsb
Copy link

webrsb commented Jun 28, 2021

The package.json defined dist/vue-next-rx.esm.js, but vite couldn't find it out at dist folder. That's the problem.

@NOPR9D
Copy link
Member

NOPR9D commented Jul 22, 2022

So reopen

@NOPR9D NOPR9D reopened this Jul 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants