For Workes & Pages, what is the name of the domain?
first build fail
What is the error number?
there is no number
What is the error message?
21:17:05.622 SyntaxError: Unexpected token ‘with’ 21:17:05.622 at ESMLoader.moduleStrategy (node:internal/modules/esm/translators:119:18) 21:17:05.623 at ESMLoader.moduleProvider (node:internal/modules/esm/loader:468:14) 21:17:05.635 Failed: Error while executing user command. Exited with error code: 1 21:17:05.645 Failed: build command exited with code: 1 21:17:06.589 Failed: error occurred while running build command
What is the issue or error you’re encountering
error when build static astro website with cf pages
What steps have you taken to resolve the issue?
i have not figured the problem through search
What are the steps to reproduce the issue?
deploy this to cf pages through web ui
Screenshot of the error
I am running into the same issue. Was building fine not long ago
Ah got it figured out, make sure you pin your dependencies to the exact version you are using locally!
this is my first time build
I’m facing the exact same issue, and not a long time ago all was working perfectly. I remember activating CF web analytics before this starting happens, but it would be strange if it were due to this… I also returned all possible changes to was it like before this issue, but nothing, I’m starting to think that it is a change in the CF deploy or something…
Heyo,
Astro is now using a new JS proposal called Import Attributes
These are supported (in the current proposed version) in Node.js 18.20+ (ref: Modules: ECMAScript modules | Node.js v22.5.0 Documentation )
The default Node.js version in the v2 build system is 18.17.1 so you will need to update that. You can specify a NODE_VERSION
environment variable with a value of 22
(use latest Node.js v20) or 18.20
(to do a smaller upgrade to unblock) or other.
I created a .nvmrc with my local node version and it works as well, I just figure out right now and I was going to reply the issue and I viewed your reply, thanks!
this does not fix the problem
|16:17:42.086|Cloning repository...|
|---|---|
|16:17:43.396|From https://github.com/mahran-alsarea/mahran-page|
|16:17:43.396| * branch 5d31f5e4e249321f963523192a60ed5c7695213d -> FETCH_HEAD|
|16:17:43.396||
|16:17:43.472|HEAD is now at 5d31f5e Create astro.yml|
|16:17:43.473||
|16:17:43.565||
|16:17:43.566|Using v2 root directory strategy|
|16:17:43.592|Success: Finished cloning repository files|
|16:17:45.340|Checking for configuration in a wrangler.toml configuration file (BETA)|
|16:17:45.341||
|16:17:45.454|No wrangler.toml file found. Continuing.|
|16:17:45.626|Detected the following tools from environment: [email protected] , [email protected] |
|16:17:45.626|Installing nodejs 20.5.1|
|16:17:45.710|nodejs 20.5.1 is already installed|
|16:17:46.276|Installing project dependencies: npm install --progress=false|
|16:17:58.754||
|16:17:58.755|added 492 packages, and audited 493 packages in 12s|
|16:17:58.755||
|16:17:58.755|190 packages are looking for funding|
|16:17:58.755| run `npm fund` for details|
|16:17:58.756||
|16:17:58.756|found 0 vulnerabilities|
|16:17:58.782|Executing user command: npm run build|
|16:17:59.433||
|16:17:59.433|> [email protected] build|
|16:17:59.434|> astro check && astro build|
|16:17:59.434||
|16:17:59.722|SyntaxError: Unexpected token 'with'|
|16:17:59.722| at DefaultModuleLoader.moduleStrategy (node:internal/modules/esm/translators:116:18)|
|16:17:59.723| at DefaultModuleLoader.moduleProvider (node:internal/modules/esm/loader:190:14)|
|16:17:59.736|Failed: Error while executing user command. Exited with error code: 1|
|16:17:59.748|Failed: build command exited with code: 1|
|16:18:00.582|Failed: error occurred while running build command|
it works in my local version
after changing to 22.4.1 which is the local version it worked , thanks
system
Closed
July 20, 2024, 1:24pm
11
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.