fastly / next-compute-js

Run Next.js on Fastly Compute
MIT License
75 stars 5 forks source link

Unable to serve locally #8

Closed AndyM10 closed 2 years ago

AndyM10 commented 2 years ago

Description

I am trying to bolt this onto an existing Next application however I am running into an issue when trying to run fastly-serve: next build && cd compute-js && fastly compute verbose.

Process command:
    sh -c npx check-next-version && npx @fastly/compute-js-static-publish --build-static && $(npm bin)/webpack && $(npm bin)/js-compute-runtime ./bin/index.js ./bin/main.wasm

Next.js version: 12.3.0
Fastly Compute@Edge JavaScript Static Publisher
Building loader...
Public directory '/Users/AMorrison/Dunelm/TCB/mfe-web-aggregator'.
No static directories defined.
Using exclude directories: ./node_modules, ./compute-js, ./pages, ./.next/cache, ./
Applying 0 custom content type(s).
Using include directories: ./.next, ./static, ./public
Warning: Unknown file type /.next/BUILD_ID...
/.next/build-manifest.json: "application/json"
/.next/export-marker.json: "application/json"
/.next/images-manifest.json: "application/json"
/.next/next-server.js.nft.json: "application/json"
/.next/package.json: "application/json"
/.next/prerender-manifest.json: "application/json"
/.next/react-loadable-manifest.json: "application/json"
/.next/required-server-files.json: "application/json"
/.next/routes-manifest.json: "application/json"
/.next/serverless/chunks/120.js: "application/javascript"
/.next/serverless/chunks/173.js: "application/javascript"
/.next/serverless/chunks/242.js: "application/javascript"
/.next/serverless/chunks/322.js: "application/javascript"
/.next/serverless/chunks/669.js: "application/javascript"
/.next/serverless/chunks/787.js: "application/javascript"
/.next/serverless/chunks/font-manifest.json: "application/json"
/.next/serverless/font-manifest.json: "application/json"
/.next/serverless/middleware-manifest.json: "application/json"
/.next/serverless/pages/404.html: "text/html"
/.next/serverless/pages/500.html: "text/html"
/.next/serverless/pages/_error.js: "application/javascript"
/.next/serverless/pages/account/callback.html: "text/html"
/.next/serverless/pages/account.html: "text/html"
/.next/serverless/pages/checkout/payment/card.js: "application/javascript"
/.next/serverless/pages/checkout/payment.js: "application/javascript"
/.next/serverless/pages/checkout/success.js: "application/javascript"
/.next/serverless/pages/checkout.js: "application/javascript"
/.next/serverless/pages/product/[id].js: "application/javascript"
/.next/serverless/pages/product.js: "application/javascript"
/.next/serverless/pages-manifest.json: "application/json"
/.next/serverless/webpack-runtime.js: "application/javascript"
/.next/static/bOSiri3YDkdDfRKpquGTy/_buildManifest.js: "application/javascript"
/.next/static/bOSiri3YDkdDfRKpquGTy/_ssgManifest.js: "application/javascript"
/.next/static/chunks/framework-5f4595e5518b5600.js: "application/javascript"
/.next/static/chunks/main-8db7d21a15d54ad1.js: "application/javascript"
/.next/static/chunks/pages/_app-812465b832720c1e.js: "application/javascript"
/.next/static/chunks/pages/_error-a4ba2246ff8fb532.js: "application/javascript"
/.next/static/chunks/pages/account/callback-bc0546f99f624958.js: "application/javascript"
/.next/static/chunks/pages/account-bdda54fe61e1af28.js: "application/javascript"
/.next/static/chunks/pages/checkout/payment/card-234891b951cdbd84.js: "application/javascript"
/.next/static/chunks/pages/checkout/payment-f0ecb009b33de20a.js: "application/javascript"
/.next/static/chunks/pages/checkout/success-f6a03b23b958bc07.js: "application/javascript"
/.next/static/chunks/pages/checkout-1e04e751b75682af.js: "application/javascript"
/.next/static/chunks/pages/product/[id]-80116b732c66e801.js: "application/javascript"
/.next/static/chunks/pages/product-e84983e2b55144e5.js: "application/javascript"
/.next/static/chunks/polyfills-c67a75d1b6f99dc8.js: "application/javascript"
/.next/static/chunks/webpack-966019665164920b.js: "application/javascript"
Warning: Unknown file type /.next/trace...
Application is not a SPA.
Application specifies no 'not found (404)' page.
🚀 Wrote static file loader for 49 file(s).

Simply running fastly compute serve from inside the compute-js folder seems to isolate the problem to these two files however these get generated during the next build process.

ERROR: error during execution process:

Warning: Unknown file type /.next/BUILD_ID...
Warning: Unknown file type /.next/trace....

Versions

harmony7 commented 2 years ago

Hi, are you able to run fastly compute serve --verbose from your compute-js folder? Mainly I'd like to see what you get after the ERROR: error during execution process:.

Also I regret the confusion but those "Warning: Unknown file type" messages are actually not a problem and they can be ignored. I'll be suppressing them in the next release of this tool.

AndyM10 commented 2 years ago

ahhh ok, running in verbose in compute-js gives the following.

ERROR: error during execution process.

If you believe this error is the result of a bug, please file an issue: https://github.com/fastly/cli/issues/new?labels=bug&template=bug_report.md
harmony7 commented 2 years ago

oh pardon. can you paste what you get BEFORE the ERROR: error during execution process. ?

AndyM10 commented 2 years ago

No problem,

Fastly API endpoint: https://api.fastly.com
Verifying package manifest...
Verifying local javascript toolchain...

Checking if 'npm' is installed...
Found 'npm' at /Users/AMorrison/.nvm/versions/node/v16.13.0/bin/npm

Checking if manifest 'package.json' exists...
Found 'package.json' at /Users/AMorrison/Dunelm/TCB/mfe-web-aggregator/compute-js/package.json

Checking if '@fastly/js-compute' is defined in 'package.json'...
Found '@fastly/js-compute' in 'package.json'

Installing package dependencies...

up to date, audited 289 packages in 701ms

62 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

Checking if 'js-compute-runtime' is installed...
Found 'js-compute-runtime' at /Users/AMorrison/Dunelm/TCB/mfe-web-aggregator/compute-js/node_modules/.bin/js-compute-runtime

Checking manifest 'fastly.toml' contains a build script...
Found [scripts.build] 'npx check-next-version && npx @fastly/compute-js-static-publish --build-static && $(npm bin)/webpack && $(npm bin)/js-compute-runtime ./bin/index.js ./bin/main.wasm'

Running [scripts.build]...

Process command:
    sh -c npx check-next-version && npx @fastly/compute-js-static-publish --build-static && $(npm bin)/webpack && $(npm bin)/js-compute-runtime ./bin/index.js ./bin/main.wasm

Next.js version: 12.3.0
Fastly Compute@Edge JavaScript Static Publisher
Building loader...
Public directory '/Users/AMorrison/Dunelm/TCB/mfe-web-aggregator'.
No static directories defined.
Using exclude directories: ./node_modules, ./compute-js, ./pages, ./.next/cache, ./
Applying 0 custom content type(s).
Using include directories: ./.next, ./static, ./public
Warning: Unknown file type /.next/BUILD_ID...
/.next/build-manifest.json: "application/json"
/.next/export-marker.json: "application/json"
/.next/images-manifest.json: "application/json"
/.next/next-server.js.nft.json: "application/json"
/.next/package.json: "application/json"
/.next/prerender-manifest.json: "application/json"
/.next/react-loadable-manifest.json: "application/json"
/.next/required-server-files.json: "application/json"
/.next/routes-manifest.json: "application/json"
/.next/serverless/chunks/120.js: "application/javascript"
/.next/serverless/chunks/173.js: "application/javascript"
/.next/serverless/chunks/242.js: "application/javascript"
/.next/serverless/chunks/322.js: "application/javascript"
/.next/serverless/chunks/669.js: "application/javascript"
/.next/serverless/chunks/787.js: "application/javascript"
/.next/serverless/chunks/font-manifest.json: "application/json"
/.next/serverless/font-manifest.json: "application/json"
/.next/serverless/middleware-manifest.json: "application/json"
/.next/serverless/pages/404.html: "text/html"
/.next/serverless/pages/500.html: "text/html"
/.next/serverless/pages/_error.js: "application/javascript"
/.next/serverless/pages/account/callback.html: "text/html"
/.next/serverless/pages/account.html: "text/html"
/.next/serverless/pages/checkout/payment/card.js: "application/javascript"
/.next/serverless/pages/checkout/payment.js: "application/javascript"
/.next/serverless/pages/checkout/success.js: "application/javascript"
/.next/serverless/pages/checkout.js: "application/javascript"
/.next/serverless/pages/product/[id].js: "application/javascript"
/.next/serverless/pages/product.js: "application/javascript"
/.next/serverless/pages-manifest.json: "application/json"
/.next/serverless/webpack-runtime.js: "application/javascript"
/.next/static/bOSiri3YDkdDfRKpquGTy/_buildManifest.js: "application/javascript"
/.next/static/bOSiri3YDkdDfRKpquGTy/_ssgManifest.js: "application/javascript"
/.next/static/chunks/framework-5f4595e5518b5600.js: "application/javascript"
/.next/static/chunks/main-8db7d21a15d54ad1.js: "application/javascript"
/.next/static/chunks/pages/_app-812465b832720c1e.js: "application/javascript"
/.next/static/chunks/pages/_error-a4ba2246ff8fb532.js: "application/javascript"
/.next/static/chunks/pages/account/callback-bc0546f99f624958.js: "application/javascript"
/.next/static/chunks/pages/account-bdda54fe61e1af28.js: "application/javascript"
/.next/static/chunks/pages/checkout/payment/card-234891b951cdbd84.js: "application/javascript"
/.next/static/chunks/pages/checkout/payment-f0ecb009b33de20a.js: "application/javascript"
/.next/static/chunks/pages/checkout/success-f6a03b23b958bc07.js: "application/javascript"
/.next/static/chunks/pages/checkout-1e04e751b75682af.js: "application/javascript"
/.next/static/chunks/pages/product/[id]-80116b732c66e801.js: "application/javascript"
/.next/static/chunks/pages/product-e84983e2b55144e5.js: "application/javascript"
/.next/static/chunks/polyfills-c67a75d1b6f99dc8.js: "application/javascript"
/.next/static/chunks/webpack-966019665164920b.js: "application/javascript"
Warning: Unknown file type /.next/trace...
Application is not a SPA.
Application specifies no 'not found (404)' page.
🚀 Wrote static file loader for 49 file(s).

ERROR: error during execution process.
harmony7 commented 2 years ago

hm. I'm not seeing webpack running in your log.

can I have you try something:

  1. Go into your fastly.toml file in your compute-js folder, and then modify the build line under [scripts]

  2. change where it says $(npm bin)/webpack to npx webpack and where it says $(npm bin)/js-compute-runtime to npx js-compute-runtime

and then try it again for me?

AndyM10 commented 2 years ago

hmmm still seem to be getting the same result.

Process command:
    sh -c npx check-next-version && npx @fastly/compute-js-static-publish --build-static && npx webpack && npx js-compute-runtime ./bin/index.js ./bin/main.wasm

Next.js version: 12.3.0
Fastly Compute@Edge JavaScript Static Publisher
Building loader...
Public directory '/Users/AMorrison/Dunelm/TCB/mfe-web-aggregator'.
No static directories defined.
Using exclude directories: ./node_modules, ./compute-js, ./pages, ./.next/cache, ./
Applying 0 custom content type(s).
Using include directories: ./.next, ./static, ./public
Warning: Unknown file type /.next/BUILD_ID...
/.next/build-manifest.json: "application/json"
/.next/export-marker.json: "application/json"
/.next/images-manifest.json: "application/json"
/.next/next-server.js.nft.json: "application/json"
/.next/package.json: "application/json"
/.next/prerender-manifest.json: "application/json"
/.next/react-loadable-manifest.json: "application/json"
/.next/required-server-files.json: "application/json"
/.next/routes-manifest.json: "application/json"
/.next/serverless/chunks/120.js: "application/javascript"
/.next/serverless/chunks/173.js: "application/javascript"
/.next/serverless/chunks/242.js: "application/javascript"
/.next/serverless/chunks/322.js: "application/javascript"
/.next/serverless/chunks/669.js: "application/javascript"
/.next/serverless/chunks/787.js: "application/javascript"
/.next/serverless/chunks/font-manifest.json: "application/json"
/.next/serverless/font-manifest.json: "application/json"
/.next/serverless/middleware-manifest.json: "application/json"
/.next/serverless/pages/404.html: "text/html"
/.next/serverless/pages/500.html: "text/html"
/.next/serverless/pages/_error.js: "application/javascript"
/.next/serverless/pages/account/callback.html: "text/html"
/.next/serverless/pages/account.html: "text/html"
/.next/serverless/pages/checkout/payment/card.js: "application/javascript"
/.next/serverless/pages/checkout/payment.js: "application/javascript"
/.next/serverless/pages/checkout/success.js: "application/javascript"
/.next/serverless/pages/checkout.js: "application/javascript"
/.next/serverless/pages/product/[id].js: "application/javascript"
/.next/serverless/pages/product.js: "application/javascript"
/.next/serverless/pages-manifest.json: "application/json"
/.next/serverless/webpack-runtime.js: "application/javascript"
/.next/static/bOSiri3YDkdDfRKpquGTy/_buildManifest.js: "application/javascript"
/.next/static/bOSiri3YDkdDfRKpquGTy/_ssgManifest.js: "application/javascript"
/.next/static/chunks/framework-5f4595e5518b5600.js: "application/javascript"
/.next/static/chunks/main-8db7d21a15d54ad1.js: "application/javascript"
/.next/static/chunks/pages/_app-812465b832720c1e.js: "application/javascript"
/.next/static/chunks/pages/_error-a4ba2246ff8fb532.js: "application/javascript"
/.next/static/chunks/pages/account/callback-bc0546f99f624958.js: "application/javascript"
/.next/static/chunks/pages/account-bdda54fe61e1af28.js: "application/javascript"
/.next/static/chunks/pages/checkout/payment/card-234891b951cdbd84.js: "application/javascript"
/.next/static/chunks/pages/checkout/payment-f0ecb009b33de20a.js: "application/javascript"
/.next/static/chunks/pages/checkout/success-f6a03b23b958bc07.js: "application/javascript"
/.next/static/chunks/pages/checkout-1e04e751b75682af.js: "application/javascript"
/.next/static/chunks/pages/product/[id]-80116b732c66e801.js: "application/javascript"
/.next/static/chunks/pages/product-e84983e2b55144e5.js: "application/javascript"
/.next/static/chunks/polyfills-c67a75d1b6f99dc8.js: "application/javascript"
/.next/static/chunks/webpack-966019665164920b.js: "application/javascript"
Warning: Unknown file type /.next/trace...
Application is not a SPA.
Application specifies no 'not found (404)' page.
🚀 Wrote static file loader for 49 file(s).

ERROR: error during execution process.
harmony7 commented 2 years ago

In your log I'm seeing the compute-js-static-publish complete successfully, and then no output from webpack.

can you see what happens if you type just npx webpack in the compute-js folder?

AndyM10 commented 2 years ago

Sure here you go!

npx webpack
asset index.js 4.96 MiB [emitted] [minimized] [big] (name: main) 1 related asset
orphan modules 3.49 MiB [orphan] 58 modules
runtime modules 3.28 KiB 7 modules
javascript modules 5.67 MiB
  modules by path ./ 4.98 MiB 217 modules
  modules by path ../ 707 KiB 142 modules
  optional modules 135 bytes [optional] 9 modules
  util (ignored) 15 bytes [built] [code generated]
  util (ignored) 15 bytes [built] [code generated]
json modules 244 KiB
  modules by path ./node_modules/iconv-lite/ 86.7 KiB 8 modules
  modules by path ./node_modules/browserify-sign/ 2.23 KiB
    ./node_modules/browserify-sign/browser/algorithms.json 2.07 KiB [built] [code generated]
    ./node_modules/browserify-sign/browser/curves.json 162 bytes [built] [code generated]
  + 6 modules

WARNING in configuration
The 'mode' option has not been set, webpack will fallback to 'production' for this value.
Set 'mode' option to 'development' or 'production' to enable defaults for each environment.
You can also set it to 'none' to disable any default behavior. Learn more: https://webpack.js.org/configuration/mode/

WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
This can impact web performance.
Assets:
  index.js (4.96 MiB)

WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
Entrypoints:
  main (4.96 MiB)
      index.js

WARNING in webpack performance recommendations:
You can limit the size of your bundles by using import() or require.ensure to lazy load some parts of your application.
For more info visit https://webpack.js.org/guides/code-splitting/

webpack 5.74.0 compiled with 4 warnings in 6530 ms
harmony7 commented 2 years ago

ok thanks. so that works. I'll do some more investigating on my end and get back to you.

AndyM10 commented 2 years ago

Perfect thank you!

harmony7 commented 2 years ago

Hi, I wasn't able to find the real root cause of this, but I think it's possible this happened because the warning messages are output using console.warn, which outputs to stderr. I'm published a new version (0.5.0) that suppresses those messages. I've also implemented one more best practice for specifying exit codes from a program.

Can I have you try again? Delete the compute-js directory that got created last time, and then start over using:

npx @fastly/next-compute-js@latest init

let me know how this one goes.

AndyM10 commented 2 years ago

Hi @harmony7 this builds and serves but still logs an error.

Running [scripts.build]...

Process command:
    sh -c npx check-next-version && npx @fastly/compute-js-static-publish --build-static --suppress-framework-warnings && $(npm bin)/webpack && $(npm bin)/js-compute-runtime ./bin/index.js ./bin/main.wasm

Next.js version: 12.3.0
Fastly Compute@Edge JavaScript Static Publisher
🚀 Building loader...
✔️ Public directory '/Users/AMorrison/Dunelm/TCB/mfe-web-aggregator'.
✔️ Using exclude directories: ./node_modules, ./compute-js, ./pages, ./.next/cache
✔️ Applying 0 custom content type(s).
✔️ Using include directories: ./.next, ./static, ./public
✔️ /.next/build-manifest.json: "application/json"
✔️ /.next/export-marker.json: "application/json"
✔️ /.next/images-manifest.json: "application/json"
✔️ /.next/next-server.js.nft.json: "application/json"
✔️ /.next/package.json: "application/json"
✔️ /.next/prerender-manifest.json: "application/json"
✔️ /.next/react-loadable-manifest.json: "application/json"
✔️ /.next/required-server-files.json: "application/json"
✔️ /.next/routes-manifest.json: "application/json"
✔️ /.next/serverless/chunks/120.js: "application/javascript"
✔️ /.next/serverless/chunks/173.js: "application/javascript"
✔️ /.next/serverless/chunks/242.js: "application/javascript"
✔️ /.next/serverless/chunks/322.js: "application/javascript"
✔️ /.next/serverless/chunks/669.js: "application/javascript"
✔️ /.next/serverless/chunks/787.js: "application/javascript"
✔️ /.next/serverless/chunks/font-manifest.json: "application/json"
✔️ /.next/serverless/font-manifest.json: "application/json"
✔️ /.next/serverless/middleware-manifest.json: "application/json"
✔️ /.next/serverless/pages/404.html: "text/html"
✔️ /.next/serverless/pages/500.html: "text/html"
✔️ /.next/serverless/pages/_error.js: "application/javascript"
✔️ /.next/serverless/pages/account/callback.html: "text/html"
✔️ /.next/serverless/pages/account.html: "text/html"
✔️ /.next/serverless/pages/checkout/payment/card.js: "application/javascript"
✔️ /.next/serverless/pages/checkout/payment.js: "application/javascript"
✔️ /.next/serverless/pages/checkout/success.js: "application/javascript"
✔️ /.next/serverless/pages/checkout.js: "application/javascript"
✔️ /.next/serverless/pages/product/[id].js: "application/javascript"
✔️ /.next/serverless/pages/product.js: "application/javascript"
✔️ /.next/serverless/pages-manifest.json: "application/json"
✔️ /.next/serverless/webpack-runtime.js: "application/javascript"
✔️ /.next/static/chunks/framework-5f4595e5518b5600.js: "application/javascript"
✔️ /.next/static/chunks/main-8db7d21a15d54ad1.js: "application/javascript"
✔️ /.next/static/chunks/pages/_app-812465b832720c1e.js: "application/javascript"
✔️ /.next/static/chunks/pages/_error-a4ba2246ff8fb532.js: "application/javascript"
✔️ /.next/static/chunks/pages/account/callback-bc0546f99f624958.js: "application/javascript"
✔️ /.next/static/chunks/pages/account-bdda54fe61e1af28.js: "application/javascript"
✔️ /.next/static/chunks/pages/checkout/payment/card-234891b951cdbd84.js: "application/javascript"
✔️ /.next/static/chunks/pages/checkout/payment-f0ecb009b33de20a.js: "application/javascript"
✔️ /.next/static/chunks/pages/checkout/success-f6a03b23b958bc07.js: "application/javascript"
✔️ /.next/static/chunks/pages/checkout-1e04e751b75682af.js: "application/javascript"
✔️ /.next/static/chunks/pages/product/[id]-80116b732c66e801.js: "application/javascript"
✔️ /.next/static/chunks/pages/product-e84983e2b55144e5.js: "application/javascript"
✔️ /.next/static/chunks/polyfills-c67a75d1b6f99dc8.js: "application/javascript"
✔️ /.next/static/chunks/webpack-966019665164920b.js: "application/javascript"
✔️ /.next/static/iPIg4Lu1KcgkobDciyGgl/_buildManifest.js: "application/javascript"
✔️ /.next/static/iPIg4Lu1KcgkobDciyGgl/_ssgManifest.js: "application/javascript"
✔️ /Architecture.png: "image/png"
✔️ /Architecture1.png: "image/png"
✔️ /jest.config.js: "application/javascript"
✔️ /jest.setup.js: "application/javascript"
✔️ /next.config.js: "application/javascript"
✔️ /package.json: "application/json"
✔️ /server.js: "application/javascript"
✔️ /tsconfig.json: "application/json"
✔️ /uploadAssetsS3/isServedByS3.js: "application/javascript"
✔️ /uploadAssetsS3/uploadAssetsS3.js: "application/javascript"
✅  Wrote static file loader for 112 file(s).
asset index.js 6.97 MiB [emitted] [minimized] [big] (name: main) 1 related asset
orphan modules 5.5 MiB [orphan] 121 modules
runtime modules 3.28 KiB 7 modules
javascript modules 7.7 MiB
  modules by path ./ 7 MiB 217 modules
  modules by path ../ 708 KiB 143 modules
  optional modules 135 bytes [optional] 9 modules
  util (ignored) 15 bytes [built] [code generated]
  util (ignored) 15 bytes [built] [code generated]
json modules 244 KiB
  modules by path ./node_modules/iconv-lite/ 86.7 KiB 8 modules
  modules by path ./node_modules/browserify-sign/ 2.23 KiB
    ./node_modules/browserify-sign/browser/algorithms.json 2.07 KiB [built] [code generated]
    ./node_modules/browserify-sign/browser/curves.json 162 bytes [built] [code generated]
  + 6 modules

WARNING in configuration
The 'mode' option has not been set, webpack will fallback to 'production' for this value.
Set 'mode' option to 'development' or 'production' to enable defaults for each environment.
You can also set it to 'none' to disable any default behavior. Learn more: https://webpack.js.org/configuration/mode/

WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
This can impact web performance.
Assets:
  index.js (6.97 MiB)

WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
Entrypoints:
  main (6.97 MiB)
      index.js

WARNING in webpack performance recommendations:
You can limit the size of your bundles by using import() or require.ensure to lazy load some parts of your application.
For more info visit https://webpack.js.org/guides/code-splitting/

webpack 5.74.0 compiled with 4 warnings in 6406 ms
Warn: warn  - Invalid next.config.js options detected:
Error:   - The root value has an unexpected property, target, which is not in the list of allowed properties (amp, analyticsId, assetPrefix, basePath, cleanDistDir, compiler, compress, crossOrigin, devIndicators, distDir, env, eslint, excludeDefaultMomentLocales, experimental, exportPathMap, future, generateBuildId, generateEtags, headers, httpAgentOptions, i18n, images, onDemandEntries, optimizeFonts, output, outputFileTracing, pageExtensions, poweredByHeader, productionBrowserSourceMaps, publicRuntimeConfig, reactStrictMode, redirects, rewrites, sassOptions, serverRuntimeConfig, staticPageGenerationTimeout, swcMinify, trailingSlash, typescript, useFileSystemPublicRoutes, webpack).
Error:   - The root value has an unexpected property, includeDoctype, which is not in the list of allowed properties (amp, analyticsId, assetPrefix, basePath, cleanDistDir, compiler, compress, crossOrigin, devIndicators, distDir, env, eslint, excludeDefaultMomentLocales, experimental, exportPathMap, future, generateBuildId, generateEtags, headers, httpAgentOptions, i18n, images, onDemandEntries, optimizeFonts, output, outputFileTracing, pageExtensions, poweredByHeader, productionBrowserSourceMaps, publicRuntimeConfig, reactStrictMode, redirects, rewrites, sassOptions, serverRuntimeConfig, staticPageGenerationTimeout, swcMinify, trailingSlash, typescript, useFileSystemPublicRoutes, webpack).
Error:
See more info here: https://nextjs.org/docs/messages/invalid-next-config
Promise rejected but never handled: Specified target is invalid. Provided: "serverless" should be one of server
Stack:
  5915/t.loadConfig@<stdin>:2:47000
  async*getServer@<stdin>:2:65264
  5150/t.default@<stdin>:2:66229
  8138/<@<stdin>:2:782721
  o.a@<stdin>:2:6875033
  8138@<stdin>:2:782642
  o@<stdin>:2:6874512
  @<stdin>:2:6876118
  @<stdin>:2:6876220

Creating package archive...

SUCCESS: Built package (pkg/package.tar.gz)

Checking latest Viceroy release...
Checking installed Viceroy version...

Current Viceroy version: 0.2.14
Latest Viceroy version: 0.3.0

Fetching latest Viceroy release...
Replacing Viceroy binary...
Running local server...
Wasm file: bin/main.wasm
Manifest: /Users/AMorrison/Dunelm/TCB/mfe-web-aggregator/compute-js/fastly.toml

Oct 13 09:42:27.247  WARN no backend definitions found in /Users/AMorrison/Dunelm/TCB/mfe-web-aggregator/compute-js/fastly.toml
Oct 13 09:42:27.247  INFO Listening on http://127.0.0.1:7676

however when call the service, it logs the following:


Promise rejected but never handled: Specified target is invalid. Provided: "serverless" should be one of server
Stack:
  5915/t.loadConfig@<stdin>:2:47000
  async*getServer@<stdin>:2:65264
  5150/t.default@<stdin>:2:66229
  8138/<@<stdin>:2:782721
  o.a@<stdin>:2:6875037
  8138@<stdin>:2:782642
  o@<stdin>:2:6874516
  @<stdin>:2:6876122
  @<stdin>:2:6876224```
AndyM10 commented 2 years ago

On further inspection this now seems to be because of issues with the next config on my side not being compatible with compute@edge platform. I will pursue this further and get back to you :) Thanks for all the help!

harmony7 commented 2 years ago

Cool, I'm glad we were able to get you past that original problem.

Please let us know when we can help you again.

harmony7 commented 2 years ago

closing this out since your original issue is resolved. please feel free to reopen or open a new ticket at that time.