Closed JounQin closed 1 year ago
@brc-add
Seems vite@v3
has more breaking change as I expected, can we upgrade to v3 in another PR? (keep 3000 for development for now).
Or can you help to review how to fix the current build error?
8:11:27 AM: Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/opt/build/repo/docs/.vitepress/.temp/app.js' imported from /opt/build/repo/dist/node/serve-8dc9ef83.js
8:11:27 AM: at new NodeError (node:internal/errors:372:5)
8:11:27 AM: at finalizeResolution (node:internal/modules/esm/resolve:437:11)
8:11:27 AM: at moduleResolve (node:internal/modules/esm/resolve:1009:10)
8:11:27 AM: at defaultResolve (node:internal/modules/esm/resolve:1218:11)
8:11:27 AM: at ESMLoader.resolve (node:internal/modules/esm/loader:580:30)
8:11:27 AM: at ESMLoader.getModuleJob (node:internal/modules/esm/loader:294:18)
8:11:27 AM: at ESMLoader.import (node:internal/modules/esm/loader:380:22)
8:11:27 AM: at importModuleDynamically (node:internal/modules/esm/translators:106:35)
8:11:27 AM: at importModuleDynamicallyCallback (node:internal/process/esm_loader:35:14)
8:11:27 AM: at renderPage (file:///opt/build/repo/dist/node/serve-8dc9ef83.js:39530:91) {
8:11:27 AM: code: 'ERR_MODULE_NOT_FOUND'
Don't upgrade Vite version for now. Let's just update the ports.
Don't upgrade Vite version for now. Let's just update the ports.
@brc-dd
The dev port is created by vite itself, so 3000
will not change if we don't upgrade.
It can be passed to createServer
too.
It can be passed to
createServer
too.
@brc-dd
You mean we change the default port manually to 5173
if the user does not provide one?
closing this in favor of #856
@brc-dd Help me. I have a similar problem. The construction failed. ๐๐๐
Project is here
Err:
PS D:\้กน็ฎ-ๆ็\vitepress-template> pnpm build
s\index' imported from D:\้กน็ฎ-ๆ็\vitepress-template\docs\.vitepress\.temp\app.js
at new NodeError (node:internal/errors:372:5)
at finalizeResolution (node:internal/modules/esm/resolve:437:11)
at moduleResolve (node:internal/modules/esm/resolve:1009:10)
at defaultResolve (node:internal/modules/esm/resolve:1218:11)
at ESMLoader.resolve (node:internal/modules/esm/loader:580:30)
at ESMLoader.getModuleJob (node:internal/modules/esm/loader:294:18)
at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:80:40) at link (node:internal/modules/esm/module_job:78:36) {
code: 'ERR_MODULE_NOT_FOUND'
}
โELIFECYCLEโ Command failed with exit code 1.
PS D:\้กน็ฎ-ๆ็\vitepress-template>
@Tyh2001 The issue is with exports
of https://github.com/FightingDesign/fighting-design, they should be something like this:
".": {
"import": "./es/index.mjs",
"require": "./lib/index.cjs",
"types": "./es/index.d.ts"
},
Currently they don't have proper extensions.
@brc-dd types
should always be the first exports
key.
@Tyh2001 The issue is with
exports
of https://github.com/FightingDesign/fighting-design, they should be something like this:".": { "import": "./es/index.mjs", "require": "./lib/index.cjs", "types": "./es/index.d.ts" },
Currently they don't have proper extensions.
Thank you very much. It was my negligence. I have solved the problem. Thank you~
types should always be the first exports key.
@JounQin Any reference on that? TypeScript's official examples have types at last, but the order shouldn't matter in JSON IG.
types should always be the first exports key.
@JounQin Any reference on that? TypeScript's official examples have types at last, but the order shouldn't matter in JSON IG.
The documentation seems having been updated. ๐ฅฒ Maybe it doesn't matter for latest TS 4.7 now.
While keys in JSON are ordered in ES spec actually, but I'm on mobile. ๐
@brc-dd I found the 4.7 announcing one at https://devblogs.microsoft.com/typescript/announcing-typescript-4-7/#package-json-exports-imports-and-self-referencing
close #715