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

First install, mock starting error #95

Closed
clabnet opened this issue Feb 24, 2024 · 2 comments
Closed

First install, mock starting error #95

clabnet opened this issue Feb 24, 2024 · 2 comments
Labels
bug dependencies Pull requests that update a dependency file

Comments

@clabnet
Copy link

clabnet commented Feb 24, 2024

Fresh clone repository, on Windows 11 system

  • pnpm i
  • pnpm dev
  • pnpm mock

Error:

> @ mock PS D:\labs\Vue-Starter> 
> cd mock && pnpm mock

> vite

  VITE v5.1.3  ready in 271 ms

  ➜  Local:   http://127.0.0.1:3000/
  ➜  press h + enter to show help
11:51:34 [vite] warning: 
virtual:fastify-routes
2  |  export default (app, opts) => {
3  |    const { prefix } = opts;
4  |    app.register(async (app) => {app.register(import('D:\labs\Vue-Starter\mock\src\routes\user-list\+handler.ts'), { prefix: prefix + '/user-list' });app.register(import('D:\labs\Vue-Starter\mock\src\routes\todos\+handler.ts'), { prefix: prefix + '/todos' });app.register(import('D:\labs\Vue-Starter\mock\src\routes\suggestions\+handler.ts'), { prefix: prefix + '/suggestions' });app.register(import('D:\labs\Vue-Starter\mock\src\routes\user-list\[id]\+handler.ts'), { prefix: prefix + '/user-list/:id' });app.register(import('D:\labs\Vue-Starter\mock\src\routes\todos\[id]\+handler.ts'), { prefix: prefix + '/todos/:id' });app.register(import('D:\labs\Vue-Starter\mock\src\routes\auth\user\+handler.ts'), { prefix: prefix + '/auth/user' });app.register(import('D:\labs\Vue-Starter\mock\src\routes\auth\sign-in\+handler.ts'), { prefix: prefix + '/auth/sign-in' });app.register(import('D:\labs\Vue-Starter\mock\src\routes\auth\otp\validate\+handler.ts'), { prefix: prefix + '/auth/otp/validate' });});
   |                                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5  |  };
6  |
The above dynamic import cannot be analyzed by Vite.
See https://github.com/rollup/plugins/tree/master/packages/dynamic-import-vars#limitations for supported dynamic import formats. If this is intended to be left as-is, you can use the /* @vite-ignore */ comment inside the import() call to suppress this warning.

  Plugin: vite:import-analysis
  File: virtual:fastify-routes
11:51:34 [vite] warning:
virtual:fastify-routes
2  |  export default (app, opts) => {
3  |    const { prefix } = opts;
4  |    app.register(async (app) => {app.register(import('D:\labs\Vue-Starter\mock\src\routes\user-list\+handler.ts'), { prefix: prefix + '/user-list' });app.register(import('D:\labs\Vue-Starter\mock\src\routes\todos\+handler.ts'), { prefix: prefix + '/todos' });app.register(import('D:\labs\Vue-Starter\mock\src\routes\suggestions\+handler.ts'), { prefix: prefix + '/suggestions' });app.register(import('D:\labs\Vue-Starter\mock\src\routes\user-list\[id]\+handler.ts'), { prefix: prefix + '/user-list/:id' });app.register(import('D:\labs\Vue-Starter\mock\src\routes\todos\[id]\+handler.ts'), { prefix: prefix + '/todos/:id' });app.register(import('D:\labs\Vue-Starter\mock\src\routes\auth\user\+handler.ts'), { prefix: prefix + '/auth/user' });app.register(import('D:\labs\Vue-Starter\mock\src\routes\auth\sign-in\+handler.ts'), { prefix: prefix + '/auth/sign-in' });app.register(import('D:\labs\Vue-Starter\mock\src\routes\auth\otp\validate\+handler.ts'), { prefix: prefix + '/auth/otp/validate' });});
   |                                                                                                                                                                                               
                                                                                                                                                                                                   
                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5  |  };
6  |
The above dynamic import cannot be analyzed by Vite.
See https://github.com/rollup/plugins/tree/master/packages/dynamic-import-vars#limitations for supported dynamic import formats. If this is intended to be left as-is, you can use the /* @vite-ignore */ comment inside the import() call to suppress this warning.

  Plugin: vite:import-analysis
  File: virtual:fastify-routes
11:51:34 [vite] warning:
virtual:fastify-routes
2  |  export default (app, opts) => {
3  |    const { prefix } = opts;
4  |    app.register(async (app) => {app.register(import('D:\labs\Vue-Starter\mock\src\routes\user-list\+handler.ts'), { prefix: prefix + '/user-list' });app.register(import('D:\labs\Vue-Starter\mock\src\routes\todos\+handler.ts'), { prefix: prefix + '/todos' });app.register(import('D:\labs\Vue-Starter\mock\src\routes\suggestions\+handler.ts'), { prefix: prefix + '/suggestions' });app.register(import('D:\labs\Vue-Starter\mock\src\routes\user-list\[id]\+handler.ts'), { prefix: prefix + '/user-list/:id' });app.register(import('D:\labs\Vue-Starter\mock\src\routes\todos\[id]\+handler.ts'), { prefix: prefix + '/todos/:id' });app.register(import('D:\labs\Vue-Starter\mock\src\routes\auth\user\+handler.ts'), { prefix: prefix + '/auth/user' });app.register(import('D:\labs\Vue-Starter\mock\src\routes\auth\sign-in\+handler.ts'), { prefix: prefix + '/auth/sign-in' });app.register(import('D:\labs\Vue-Starter\mock\src\routes\auth\otp\validate\+handler.ts'), { prefix: prefix + '/auth/otp/validate' });});
   |                                                                                                                                                                                               
                                                                                                                                                                                                   
                                                                                                                                                                                                   
                                                                                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5  |  };
6  |
The above dynamic import cannot be analyzed by Vite.
See https://github.com/rollup/plugins/tree/master/packages/dynamic-import-vars#limitations for supported dynamic import formats. If this is intended to be left as-is, you can use the /* @vite-ignore */ comment inside the import() call to suppress this warning.

  Plugin: vite:import-analysis
  File: virtual:fastify-routes
11:51:34 [vite] Pre-transform error: Bad character escape sequence, expected 4 hex characters
11:51:34 [vite] Error when evaluating SSR module /src/plugins/router.ts: failed to import "virtual:fastify-routes"
|- RollupError: Bad character escape sequence, expected 4 hex characters
    at getRollupEror (file:///D:/_LAB/labs/Vue-Starter/node_modules/.pnpm/rollup@4.12.0/node_modules/rollup/dist/es/shared/parseAst.js:375:41)
    at convertProgram (file:///D:/_LAB/labs/Vue-Starter/node_modules/.pnpm/rollup@4.12.0/node_modules/rollup/dist/es/shared/parseAst.js:1012:26)
    at parseAstAsync (file:///D:/_LAB/labs/Vue-Starter/node_modules/.pnpm/rollup@4.12.0/node_modules/rollup/dist/es/shared/parseAst.js:2158:12)
    at async ssrTransformScript (file:///D:/_LAB/labs/Vue-Starter/node_modules/.pnpm/vite@5.1.3_sass@1.71.0/node_modules/vite/dist/node/chunks/dep-stQc5rCc.js:54036:15)
    at async loadAndTransform (file:///D:/_LAB/labs/Vue-Starter/node_modules/.pnpm/vite@5.1.3_sass@1.71.0/node_modules/vite/dist/node/chunks/dep-stQc5rCc.js:53632:11)

11:51:34 [vite] Error when evaluating SSR module D:\labs\Vue-Starter\mock\src\app.ts: failed to import "/src/plugins/router.ts"
|- RollupError: Bad character escape sequence, expected 4 hex characters
    at getRollupEror (file:///D:/_LAB/labs/Vue-Starter/node_modules/.pnpm/rollup@4.12.0/node_modules/rollup/dist/es/shared/parseAst.js:375:41)
    at convertProgram (file:///D:/_LAB/labs/Vue-Starter/node_modules/.pnpm/rollup@4.12.0/node_modules/rollup/dist/es/shared/parseAst.js:1012:26)
    at parseAstAsync (file:///D:/_LAB/labs/Vue-Starter/node_modules/.pnpm/rollup@4.12.0/node_modules/rollup/dist/es/shared/parseAst.js:2158:12)
    at async ssrTransformScript (file:///D:/_LAB/labs/Vue-Starter/node_modules/.pnpm/vite@5.1.3_sass@1.71.0/node_modules/vite/dist/node/chunks/dep-stQc5rCc.js:54036:15)
    at async loadAndTransform (file:///D:/_LAB/labs/Vue-Starter/node_modules/.pnpm/vite@5.1.3_sass@1.71.0/node_modules/vite/dist/node/chunks/dep-stQc5rCc.js:53632:11)

node:internal/process/promises:289
            triggerUncaughtException(err, true /* fromPromise */);
            ^

Error [RollupError]: Bad character escape sequence, expected 4 hex characters
    at getRollupEror (file:///D:/_LAB/labs/Vue-Starter/node_modules/.pnpm/rollup@4.12.0/node_modules/rollup/dist/es/shared/parseAst.js:375:41)
    at convertProgram (file:///D:/_LAB/labs/Vue-Starter/node_modules/.pnpm/rollup@4.12.0/node_modules/rollup/dist/es/shared/parseAst.js:1012:26)
    at parseAstAsync (file:///D:/_LAB/labs/Vue-Starter/node_modules/.pnpm/rollup@4.12.0/node_modules/rollup/dist/es/shared/parseAst.js:2158:12)
    at async ssrTransformScript (file:///D:/_LAB/labs/Vue-Starter/node_modules/.pnpm/vite@5.1.3_sass@1.71.0/node_modules/vite/dist/node/chunks/dep-stQc5rCc.js:54036:15)
    at async loadAndTransform (file:///D:/_LAB/labs/Vue-Starter/node_modules/.pnpm/vite@5.1.3_sass@1.71.0/node_modules/vite/dist/node/chunks/dep-stQc5rCc.js:53632:11) {
  code: 'PARSE_ERROR',
  pos: 155
}

Node.js v20.7.0
 ELIFECYCLE  Command failed with exit code 1.
 ELIFECYCLE  Command failed with exit code 1.
PS D:\labs\Vue-Starter> 
@Shyam-Chen
Copy link
Owner

The issue stems from vite-plugin-fastify-routes.

@Shyam-Chen
Copy link
Owner

The issue has been resolved by upgrading vite-plugin-fastify-routes to version v1.1.1.

@Shyam-Chen Shyam-Chen added bug dependencies Pull requests that update a dependency file labels Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug dependencies Pull requests that update a dependency file
Projects
None yet
Development

No branches or pull requests

2 participants