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

fix(compile): Module not found bug #5470

Closed
wants to merge 1 commit into from

Conversation

xcy960815
Copy link
Collaborator

@xcy960815 xcy960815 commented Aug 25, 2023

Checklist
  • npm test passes
  • benchmarks are included
  • commit message follows commit guidelines
  • documents are updated
Description of change

@xcy960815
Copy link
Collaborator Author

xcy960815 commented Aug 25, 2023

在 常规的vue项目中通过

import { useState } from "@antv/g2/lib/interaction/utils";
import { useState } from "@antv/g2/esm/interaction/utils";
const { useState } = require("@antv/g2/lib/interaction/utils");
const { useState } = require("@antv/g2/esm/interaction/utils");

均表现正常

在nuxt3中

import { useState } from "@antv/g2/esm/interaction/utils";
import { useState } from "@antv/g2/lib/interaction/utils"; 

第二种方式表现仍和之前d3报错一样,个人认为应增加一个文档模块用于解释说明

@hustcc
Copy link
Member

hustcc commented Aug 25, 2023

在 常规的vue项目中通过

import { useState } from "@antv/g2/lib/interaction/utils";

import { useState } from "@antv/g2/esm/interaction/utils";

const { useState } = require("@antv/g2/lib/interaction/utils");

const { useState } = require("@antv/g2/esm/interaction/utils");

均表现正常

在nuxt3中

import { useState } from "@antv/g2/esm/interaction/utils";

import { useState } from "@antv/g2/lib/interaction/utils"; 

第二种方式表现仍和之前d3报错一样,个人认为应增加一个文档模块用于解释说明

为啥 nuxt 中需要单独引入某一个目录?

@xcy960815
Copy link
Collaborator Author

需要单独引入某一个目录

只是为了测试这个bug而已,

在 常规的vue项目中通过

import { useState } from "@antv/g2/lib/interaction/utils";

import { useState } from "@antv/g2/esm/interaction/utils";

const { useState } = require("@antv/g2/lib/interaction/utils");

const { useState } = require("@antv/g2/esm/interaction/utils");

均表现正常
在nuxt3中

import { useState } from "@antv/g2/esm/interaction/utils";

import { useState } from "@antv/g2/lib/interaction/utils"; 

第二种方式表现仍和之前d3报错一样,个人认为应增加一个文档模块用于解释说明

为啥 nuxt 中需要单独引入某一个目录?

只是单独为了测试而已,测试这个写法会不会在nuxt中报错,在nuxt3 只能走esm模块,因为 d3 不支持

@pearmini
Copy link
Member

我来看看这个问题,我也遇见了类似的问题。

@xcy960815
Copy link
Collaborator Author

我来看看这个问题,我也遇见了类似的问题。

嗯呐,问题原因就是只是配置了主入口路径,没有给配置子模块入口

package.json Show resolved Hide resolved
@xcy960815
Copy link
Collaborator Author

针对此问题不做修复,希望用户只使用 public API
There is no fix for this problem, and users are expected to only use the public API

@xcy960815 xcy960815 closed this Aug 28, 2023
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.

Module not found: Error: Package path ./lib/interaction/utils is not exported
4 participants