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

[Bug Report]import.meta.glob执行出错 #1691

Open
zhangfisher opened this issue Aug 2, 2024 · 1 comment
Open

[Bug Report]import.meta.glob执行出错 #1691

zhangfisher opened this issue Aug 2, 2024 · 1 comment

Comments

@zhangfisher
Copy link

Steps to reproduce

当执行包括import.meta.glob的构建时出错:

var PRESERVED = import.meta.glob("/src/pages/(_app|404).{jsx,tsx}", { eager: true });
var MODALS = import.meta.glob("/src/pages/**/[+]*.{jsx,tsx}", { eager: true });
var ROUTES = import.meta.glob(
  ["/src/pages/**/[\\w[-]*.{jsx,tsx,mdx}", "!/src/pages/**/(_!(layout)*(/*)?|_app|404)*"],
  { eager: true }
);

错误信息:

[ building ] ⠄ transform (189) ../../node_modules/.pnpm/[email protected]/node_modules/core-js/internals/array-iteration.js.farm-runtime
[ Farm ] Error: Failed to build: Error: Hook `process_module` execute failed for module `D:\Temp\Code\nodejs2\generouted\node_modules\.pnpm\@[email protected][email protected][email protected][email protected]__react@_majqdi4ud6jxgzhjc46q7ikpdi\node_modules\@generouted\react-router\dist\index.js`.
Original error: Some(GenericError("Error when glob /src/pages/(_app|404).{jsx,tsx}: BuildError { kind: Parse(ParseError { expression: \"src/pages/(_app|404).{jsx,tsx}\", locations: [ErrorEntry { fragment: \"(_app|404).{jsx,tsx}\", location: 10, kind: Nom(Eof) }] }) }\nError when glob /src/pages/**/[\\w[-]*.{jsx,tsx,mdx}: BuildError { kind: Parse(ParseError { expression: \"src/pages/**/[/w[-]*.{jsx,tsx,mdx}\", locations: [ErrorEntry { fragment: \"[/w[-]*.{jsx,tsx,mdx}\", location: 13, kind: Nom(Eof) }] }) }\nError when glob /src/pages/**/(_!(layout)*(/*)?|_app|404)*: BuildError { kind: Parse(ParseError { expression: \"src/pages/**/(_!(layout)*(/*)?|_app|404)*\", locations: [ErrorEntry { fragment: \"(_!(layout)*(/*)?|_app|404)*\", location: 13, kind: Nom(Eof) }] }) }")).
 ELIFECYCLE  Command failed with exit code 1.

Reproduce link

No response

What is actually happening?

成功构建

System Info

System:
    OS: Windows 10 10.0.19044
    CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
    Memory: 1.39 GB / 15.84 GB
  Binaries:
    Node: 18.17.1 - D:\Program Files\nodejs\node.EXE
    Yarn: 1.22.19 - D:\node_stores\npm\packages\yarn.CMD
    npm: 9.6.7 - D:\Program Files\nodejs\npm.CMD
    pnpm: 9.4.0 - D:\node_stores\npm\packages\pnpm.CMD
  Browsers:
    Chrome: 122.0.6261.112
    Edge: Spartan (44.19041.1266.0), Chromium (119.0.2151.72)
    Internet Explorer: 11.0.19041.1566
  npmPackages:
    @farmfe/core: ^1.3.12 => 1.3.12
@wre232114
Copy link
Member

["/src/pages/**/[\\w[-]*.{jsx,tsx,mdx}", "!/src/pages/**/(_!(layout)*(/*)?|_app|404)*"] 这个里面的 glob 语法 import.meta.glob 暂时还不支持。暂时可以考虑换种 glob 写法呢

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

No branches or pull requests

2 participants