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
Unable to run dev script with static target and modern client #7562
Comments
I have same problem in SSR mode. |
I'm getting the same error here since Nuxt 2.13. Also, navigation from page to page is not working anymore. When I click a |
We have discussed this here also: |
On my build the issue is modern browsers can't open the build but legacy one can. |
fwiw this has impacted us as well. we don't have
so this is half-fixed in our use case. 😕 |
@kreig303 Can you please provide us more details about your problem? It would be great if you can create a minimal reproducible repo as well. |
|
@clarkdo spoke too soon. my issue persists. would take a while to produce a "demo" which is why i hoped I could just await a new version 😕
|
|
again spoke too soon. issue seems to be all about observed behavior seems to be similar to #6442, btw. this issue got conflated (for us) with the webpack stall on modern builds that was fixed in 2.13.3 as mentioned above. |
Env:
When running target: 'static',
mode: 'spa',
modern: 'client', I don't see any The site doesn't load completely and instead all I see is the pinwheel/spinner. If I change my target: 'static',
mode: 'universal', // changed from 'spa'
modern: 'client', Then I do see What I'd like is to use modern mode to make debugging async functions (ex: However, when I deploy I want to statically generate the whole site with |
I have had to comment out no build errors, but just a pin wheel
|
There is a bug reported and fixed in v2.14.3 which might be relalted to this issue, can you please double check with v2.14.3 ? If issue still persists, please provide us a repo or steps to reproduce the issue. |
@shainegordon (and others) further research showed that the ESM build wasn't an issue per se (2.14.1+)... it seemed to mainly surround the hot swapping capability of the development builds which caused the "spinning wheel of doom". 😖 we refined the modern flag further in
we have an override flag for dev to include test so ymmv but a direct test of the |
I just upgraded to however, I then used as soon as I added |
i would second the necessity of an explicit |
Thanks for the info , I'll take a look by using |
this happens upon repeated startups and shutdowns of nuxt in again, looks to be a consequence of the hot reload capabilities workaround: disable |
@kreig303 @shainegordon Thanks for providing info about how to reproduce the issue, the issue is because of racing condition between modern and legacy build, I've opened a pr to fix it, if you want to try it in advance, you can verify it by applying my pr change to you local @nuxt/webpack in node_module. |
@clarkdo i see this is slated for release so i will confirm once the release has gone live |
v2.14.4 released :) |
wonderful. updated all our projects, and modern is now working across the board in development mode |
i did some extensive work with that app in the last day. the thanks for all your help @clarkdo |
Hello, Unfortunately still having the same issue on version It builds correctly and we get our |
@youbicode Can you provide use more details about you issue ?
|
in order to use the CDN env var on runtime, we got this hooks: {
/*
* the renderer hook is a middleware which handles and serves all SSR and asset requests.
* https://nuxtjs.org/api/internals-renderer#hooks
*/
render: {
// Nuxt doesn't allow changing the cdn (publicPath) at run time, it's stored in the manifest at build time
// When resources for render are loaded, this hook updates the publicPath inside the manifest with our cdn
resourcesLoaded(resources) {
const path = process.env.BASE_STATIC_URL;
const cdn = path !== '/_nuxt/' ? `${path}/_nuxt/` : path;
// inject the cdn path for legacy browsers
if (resources.clientManifest) {
resources.clientManifest.publicPath = cdn;
}
// inject the cdn path for modern browsers
if (resources.modernManifest) {
resources.modernManifest.publicPath = cdn;
}
},
},
}, cdn.ts : plugin file export default async (context: Context) => {
const { $config } = context;
const path = $config.cdnPath;
const cdn = path !== '/_nuxt/' ? `${path}/_nuxt/` : path;
// specify the base path for all the assets within the app on the fly
// `cdnPath` is the env variable injected on runtime
// for more: https://webpack.js.org/guides/public-path/
// @ts-ignore
__webpack_public_path__ = cdn;
}; Basically when |
Version
v2.13.0
Reproduction link
https://github.com/hannes-k/nuxt-modern
Steps to reproduce
Create new nuxt project
add
target: 'static'
andmodern: 'client'
tonuxt.config.js
npm run dev
ctrl + c
npm run dev
What is expected ?
Developer mode should be started.
What is actually happening?
Additional comments?
The error does not always occur. Sometimes it works, but the next time it does not.
The text was updated successfully, but these errors were encountered: