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
using latest packages vite-ssg build throws Invalid value used as weak map key #168
Comments
hi, |
sorry didnt see the component name |
hmm i think its not related, that one shows es error |
okay here is the repo , can see that ive commented out all the modules/ant.ts |
@u007 what version of node are you using? I'm using node 16.3 LTS: there is no way, I think import { Col, Row, Carousel, DatePicker, Layout, Button, Drawer, Form, Alert, Spin } from 'ant-design-vue/es'; and the original: import { Col, Row, Carousel, DatePicker, Layout, Button, Drawer, Form, Alert, Spin } from 'ant-design-vue'; Error [ERR_MODULE_NOT_FOUND]: Cannot find module 'F:\work\projects\quini\GitHub\issue-repro\vite-ssg-168-ant\node_modules\ant-design-vue\es\alert\style\css' imported from F:\work\projects\quini\GitHub\issue-repr
o\vite-ssg-168-ant\.vite-ssg-temp\main.mjs
at new NodeError (node:internal/errors:371:5)
at finalizeResolution (node:internal/modules/esm/resolve:416:11)
at moduleResolve (node:internal/modules/esm/resolve:932:10)
at defaultResolve (node:internal/modules/esm/resolve:1044:11)
at ESMLoader.resolve (node:internal/modules/esm/loader:422:30)
at ESMLoader.getModuleJob (node:internal/modules/esm/loader:222:40)
at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:76:40)
at link (node:internal/modules/esm/module_job:75:36) {
code: 'ERR_MODULE_NOT_FOUND' patched ant package.json (added exports entry): "exports": {
"./*": "./*",
".": {
"require": "./lib/index.js",
"import": "./lib/index.js",
"types": "./lib/index.d.ts"
},
"./es": {
"import": "./es/index.js",
"types": "./es/index.d.ts"
}
},
"main": "lib/index.js",
"module": "es/index.js",
"unpkg": "dist/antd.min.js",
"typings": "lib/index.d.ts", I also tried removing Error [ERR_MODULE_NOT_FOUND]: Cannot find module 'F:\work\projects\quini\GitHub\issue-repro\vite-ssg-168-ant\node_modules\ant-design-vue\es\layout\style\css' imported from F:\work\projects\quini\GitHub\issue-rep
ro\vite-ssg-168-ant\.vite-ssg-temp\main.mjs
at new NodeError (node:internal/errors:371:5)
at finalizeResolution (node:internal/modules/esm/resolve:416:11)
at moduleResolve (node:internal/modules/esm/resolve:932:10)
at defaultResolve (node:internal/modules/esm/resolve:1044:11)
at ESMLoader.resolve (node:internal/modules/esm/loader:422:30)
at ESMLoader.getModuleJob (node:internal/modules/esm/loader:222:40)
at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:76:40)
at link (node:internal/modules/esm/module_job:75:36) {
code: 'ERR_MODULE_NOT_FOUND'
} |
iam using node 14, hmm so there is problem on node 16 also |
okay i switched to node 16, its using pnpm (reminder).
|
but having modules/ant.ts
does not have that problem |
Having the same issue. How did you fix? |
u have to check which component is missing, if u r using ant design, u have to either import it or manually use like what i code to make it run. the error basically related to missing component |
@u007 there is no way man, I also test your repo with #239 (you can check it using a previous variant here #150 (comment), for context read this entry #150 (comment) but use the [vite-ssg] An internal error occurred.
[vite-ssg] Please report an issue, if none already exists: https://github.com/antfu/vite-ssg/issues
F:\work\projects\quini\GitHub\issue-repro\vite-ssg-issues\vite-ssg-ant-master\node_modules\.pnpm\ant-design-vue@3.0.0-beta.4_ae87cbba5ec93a01f3fe1197df446ca3\node_modules\ant-design-vue\lib\style\index.css:5
[class^=ant-]::-ms-clear,
^^
SyntaxError: Unexpected token '^=' |
that error seems new, i think u need to go one by one to remove all pages, and then slowly add back 1 by 1 pages and component to see when it happen again |
Too much work, I start patching the ant design icons but I stoppped since we need to add each es/icons entry to the package.json file to the exports entry. Edit: using esm instead cjs to avoid previous error |
See: antfu-collective/vite-ssg#168 Signed-off-by: Fery Wardiyanto <ferywardiyanto@gmail.com>
Come across similar issue, but in my case is happened after I upgrade to Here's my error output, just in case
|
Me too. |
Normally every time I facing this problem is most related to a invalid DOM element in vue template, try to comment out code page by page then go smaller scale, finally you will find it. |
I got the same issue because I've a wrong element name |
@hannoeru that is sad case, same here |
when i run vite build, it completed successfully.
but when i run npx vite-ssg build (building for server...)
my package.json
The text was updated successfully, but these errors were encountered: