antvis / F6

F6 is a graph visualization engine which provides quick and smooth operations on mobile devices.
https://f6.antv.vision
MIT License
136 stars 22 forks source link

vite本地跑时 @antv/f6-hammerjs报错 #176

Open qq415989157 opened 1 month ago

qq415989157 commented 1 month ago

X [ERROR] Failed to resolve entry for package "@antv/f6-hammerjs". The package may have incorrect main/module/exports specified in its package.json. [plugin vite:dep-pre-bundle]

node_modules/esbuild/lib/main.js:1373:21:
  1373 │         let result = await callback({
       ╵                      ^

at packageEntryFailure (file:///D:/gongzuo/stemxell/node_modules/vite/dist/node/chunks/dep-41cf5ffd.js:28725:11)
at resolvePackageEntry (file:///D:/gongzuo/stemxell/node_modules/vite/dist/node/chunks/dep-41cf5ffd.js:28722:5)
at tryNodeResolve (file:///D:/gongzuo/stemxell/node_modules/vite/dist/node/chunks/dep-41cf5ffd.js:28453:20)
at Context.resolveId (file:///D:/gongzuo/stemxell/node_modules/vite/dist/node/chunks/dep-41cf5ffd.js:28212:28)
at Object.resolveId (file:///D:/gongzuo/stemxell/node_modules/vite/dist/node/chunks/dep-41cf5ffd.js:44276:64)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async file:///D:/gongzuo/stemxell/node_modules/vite/dist/node/chunks/dep-41cf5ffd.js:65937:21
at async file:///D:/gongzuo/stemxell/node_modules/vite/dist/node/chunks/dep-41cf5ffd.js:39976:34
at async requestCallbacks.on-resolve (D:\gongzuo\stemxell\node_modules\esbuild\lib\main.js:1373:22)
at async handleRequest (D:\gongzuo\stemxell\node_modules\esbuild\lib\main.js:729:13)

This error came from the "onResolve" callback registered here:

node_modules/esbuild/lib/main.js:1292:20:
  1292 │       let promise = setup({
       ╵                     ^

at setup (file:///D:/gongzuo/stemxell/node_modules/vite/dist/node/chunks/dep-41cf5ffd.js:39956:19)
at handlePlugins (D:\gongzuo\stemxell\node_modules\esbuild\lib\main.js:1292:21)
at buildOrContextImpl (D:\gongzuo\stemxell\node_modules\esbuild\lib\main.js:978:5)
at Object.buildOrContext (D:\gongzuo\stemxell\node_modules\esbuild\lib\main.js:786:5)        
at D:\gongzuo\stemxell\node_modules\esbuild\lib\main.js:2186:68
at new Promise (<anonymous>)
at Object.context (D:\gongzuo\stemxell\node_modules\esbuild\lib\main.js:2186:27)
at Object.context (D:\gongzuo\stemxell\node_modules\esbuild\lib\main.js:2026:58)
at prepareEsbuildOptimizerRun (file:///D:/gongzuo/stemxell/node_modules/vite/dist/node/chunks/dep-41cf5ffd.js:46041:35)

The plugin "vite:dep-pre-bundle" was triggered by this import

node_modules/@antv/g-mobile/esm/events.js:1:35:
  1 │ import Hammer, { TouchInput } from '@antv/f6-hammerjs';
    ╵                                    ~~~~~~~~~~~~~~~~~~~

D:\gongzuo\stemxell\node_modules\esbuild\lib\main.js:1649 let error = new Error(${text}${summary}); ^

Error: Build failed with 1 error: node_modules/esbuild/lib/main.js:1373:21: ERROR: [plugin: vite:dep-pre-bundle] Failed to resolve entry for package "@antv/f6-hammerjs". The package may have incorrect main/module/exports specified in its package.json. at failureErrorWithLog (D:\gongzuo\stemxell\node_modules\esbuild\lib\main.js:1649:15)
at D:\gongzuo\stemxell\node_modules\esbuild\lib\main.js:1058:25 at D:\gongzuo\stemxell\node_modules\esbuild\lib\main.js:1525:9 at process.processTicksAndRejections (node:internal/process/task_queues:95:5) { errors: [ { detail: Error: Failed to resolve entry for package "@antv/f6-hammerjs". The package may have incorrect main/module/exports specified in its package.json. at packageEntryFailure (file:///D:/gongzuo/stemxell/node_modules/vite/dist/node/chunks/dep-41cf5ffd.js:28725:11) at resolvePackageEntry (file:///D:/gongzuo/stemxell/node_modules/vite/dist/node/chunks/dep-41cf5ffd.js:28722:5) at tryNodeResolve (file:///D:/gongzuo/stemxell/node_modules/vite/dist/node/chunks/dep-41cf5ffd.js:28453:20) at Context.resolveId (file:///D:/gongzuo/stemxell/node_modules/vite/dist/node/chunks/dep-41cf5ffd.js:28212:28) at Object.resolveId (file:///D:/gongzuo/stemxell/node_modules/vite/dist/node/chunks/dep-41cf5ffd.js:44276:64) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async file:///D:/gongzuo/stemxell/node_modules/vite/dist/node/chunks/dep-41cf5ffd.js:65937:21 at async file:///D:/gongzuo/stemxell/node_modules/vite/dist/node/chunks/dep-41cf5ffd.js:39976:34 at async requestCallbacks.on-resolve (D:\gongzuo\stemxell\node_modules\esbuild\lib\main.js:1373:22) at async handleRequest (D:\gongzuo\stemxell\node_modules\esbuild\lib\main.js:729:13),
id: '', location: { column: 21, file: 'node_modules/esbuild/lib/main.js', length: 0, line: 1373, lineText: ' let result = await callback({\n' + ' at packageEntryFailure (file:///D:/gongzuo/stemxell/node_modules/vite/dist/node/chunks/dep-41cf5ffd.js:28725:11)\n' + ' at resolvePackageEntry (file:///D:/gongzuo/stemxell/node_modules/vite/dist/node/chunks/dep-41cf5ffd.js:28722:5)\n' + ' at tryNodeResolve (file:///D:/gongzuo/stemxell/node_modules/vite/dist/node/chunks/dep-41cf5ffd.js:28453:20)\n' + ' at Context.resolveId (file:///D:/gongzuo/stemxell/node_modules/vite/dist/node/chunks/dep-41cf5ffd.js:28212:28)\n' + ' at Object.resolveId (file:///D:/gongzuo/stemxell/node_modules/vite/dist/node/chunks/dep-41cf5ffd.js:44276:64)\n' + ' at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n' + ' at async file:///D:/gongzuo/stemxell/node_modules/vite/dist/node/chunks/dep-41cf5ffd.js:65937:21\n' + ' at async file:///D:/gongzuo/stemxell/node_modules/vite/dist/node/chunks/dep-41cf5ffd.js:39976:34\n' + ' at async requestCallbacks.on-resolve (D:\gongzuo\stemxell\node_modules\esbuild\lib\main.js:1373:22)\n' + ' at async handleRequest (D:\gongzuo\stemxell\node_modules\esbuild\lib\main.js:729:13)', namespace: 'file', suggestion: '' }, notes: [ { location: { column: 20, file: 'node_modules/esbuild/lib/main.js', length: 0, line: 1292, lineText: ' let promise = setup({\n' + ' at setup (file:///D:/gongzuo/stemxell/node_modules/vite/dist/node/chunks/dep-41cf5ffd.js:39956:19)\n' + ' at handlePlugins (D:\gongzuo\stemxell\node_modules\esbuild\lib\main.js:1292:21)\n' + ' at buildOrContextImpl (D:\gongzuo\stemxell\node_modules\esbuild\lib\main.js:978:5)\n' + ' at Object.buildOrContext (D:\gongzuo\stemxell\node_modules\esbuild\lib\main.js:786:5)\n' + ' at D:\gongzuo\stemxell\node_modules\esbuild\lib\main.js:2186:68\n' +
' at new Promise ()\n' + ' at Object.context (D:\gongzuo\stemxell\node_modules\esbuild\lib\main.js:2186:27)\n' + ' at Object.context (D:\gongzuo\stemxell\node_modules\esbuild\lib\main.js:2026:58)\n' + ' at prepareEsbuildOptimizerRun (file:///D:/gongzuo/stemxell/node_modules/vite/dist/node/chunks/dep-41cf5ffd.js:46041:35)', namespace: 'file', suggestion: '' }, text: 'This error came from the "onResolve" callback registered here:' }, { location: { column: 35, file: 'node_modules/@antv/g-mobile/esm/events.js', length: 19, line: 1, lineText: "import Hammer, { TouchInput } from '@antv/f6-hammerjs';", namespace: '', suggestion: '' }, text: 'The plugin "vite:dep-pre-bundle" was triggered by this import' } ], pluginName: 'vite:dep-pre-bundle', text: 'Failed to resolve entry for package "@antv/f6-hammerjs". The package may have incorrect main/module/exports specified in its package.json.' } ], warnings: [] } @antv/f6-hammerjs版本0.0.19 环境vue3-3.3.4 vite-4.5.3 这是什么问题

zhouwei0192 commented 2 weeks ago

我也遇到了这个问题,您解决了吗?