- 23 Sep, 2022 5 commits
-
-
JJ Kasper authored
-
JJ Kasper authored
This updates to ensure we properly error during static generation when a non-dynamic SSR error is thrown so that unexpected errors are not tolerated. This also fixes the static generation async storage not being shared correctly due to different instances being created during bundling.
-
abdennor authored
I had the same issue, so the fix that worked for me was pulled from this thread https://stackoverflow.com/a/71870995 I have been experiencing the same problem lately with NextJS and i am not sure if my observations are applicable to other libraries. I had been wrapping my components with an improper tag that is, NextJS is not comfortable having a p tag wrapping your divs, sections etc so it will yell "Hydration failed because the initial UI does not match what was rendered on the server". So I solved this problem by examining how my elements were wrapping each other. With material UI you would need to be cautious for example if you use a Typography component as a wrapper, the default value of the component prop is "p" so you will experience the error if you don't change the component value to something semantic. So in my own opinion based on my personal experience the problem is caused by improper arrangement of html elements and to solve the problem in the context of NextJS one will have to reevaluate how they are arranging their html element <!-- Thanks for opening a PR! Your contribution is much appreciated. To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change that you're making: --> ## Documentation / Examples - [x] Make sure the linting passes by running `pnpm lint` - [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md) Co-authored-by:
JJ Kasper <jj@jjsweb.site>
-
David Hay authored
Next.js-hydration now triggered after gtag is initialized. Fixed by adding _document.js and appropriate script elements. --- ## Documentation / Examples - [X] Related issues linked using fixes #40410 - [X] Make sure the linting passes by running `pnpm lint` - [X] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md) Next.js-hydration now triggered after gtag is initialized.
-
JJ Kasper authored
Follow-up to https://github.com/vercel/next.js/pull/40815 ensures we skip attempting to publish private packages like `next-swc` x-ref: https://github.com/vercel/next.js/actions/runs/3109438515/jobs/5039954716
-
- 22 Sep, 2022 22 commits
-
-
JJ Kasper authored
-
JJ Kasper authored
x-ref: [slack thread](https://vercel.slack.com/archives/C035J346QQL/p1663822388387959) x-ref: https://github.com/vercel/next.js/actions/runs/3108897192/jobs/5038639320 x-ref: https://github.com/vercel/next.js/actions/runs/3107019059/jobs/5034678245 x-ref: https://github.com/vercel/next.js/actions/runs/3104956805/jobs/5030065922
-
JJ Kasper authored
This updates our `publish-release` script to bypass lerna so that we can retry publishing automatically when there is an npm error and tolerate non-fatal publish errors like already existing published versions. Currently this will only allow publishing a canary release to ensure it is working as expected and in a follow-up we can enable the stable publish handling. Separately we can investigate moving canaries away from `npm` to reduce the number of versions being created there. x-ref: https://github.com/vercel/next.js/pull/40812 x-ref: https://github.com/vercel/next.js/actions/runs/3108735543/jobs/5038717354#step:10:2332 x-ref: https://github.com/vercel/next.js/actions/runs/3108335849/jobs/5038069555
-
JJ Kasper authored
This updates our `publish-native` script to tolerate the already published npm error so that we can retry publishing on an `npm` [service error like noticed here](https://github.com/vercel/next.js/actions/runs/3108335849/jobs/5037966318#step:10:2076). We probably want to migrate away from using `lerna` for publishing the non-swc packages as well so that we can retry there as well but will investigate that in a follow-up. x-ref: https://github.com/vercel/next.js/actions/runs/3108335849/jobs/5038069555
-
JJ Kasper authored
-
Maurício Mutte authored
This fixes anchor link in `static-html-export.md` ## Documentation / Examples - [x] Make sure the linting passes by running `pnpm lint` - [x] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
-
JJ Kasper authored
-
Hannes Bornö authored
Moves font related types to `next/font` so they can be reused in font loaders. Adds an argument to font loaders, the relative path from the app root to the module consuming the loader. Needed for resolving local files relative to the module calling it. Also used to improve error message. Adds `@next/font/local` font loader. Similar to `@next/font/google` but used to host locally downloaded font files.
-
JJ Kasper authored
Follow-up to https://github.com/vercel/next.js/pull/40780 adds the extra config that is still needed for release stats. x-ref: https://github.com/vercel/next.js/actions/runs/3103134847/jobs/5026594626
-
Steven authored
Let's open the deploy link in a new window so the link isn't blocked when running an an iframe, such as Stackblitz. Previously, this would print the following error: > Refused to display 'https://vercel.com/' in a frame because it set 'X-Frame-Options' to 'deny'
-
Hannes Bornö authored
The manifest currently gets added without file extensions.
-
Philipp Bosch authored
It looks like the code snippet was copied over from https://github.com/bvaughn/react-error-boundary but the `ErrorBoundary` component on this docs page does not have a `FallbackComponent` prop but renders the error message content itself. ## Documentation / Examples - [X] Make sure the linting passes by running `pnpm lint` - [X] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
-
Hannes Bornö authored
The issue seems to be that ` await check(() => browser.elementByCss('p').text(), 'hello world!!!')` sometimes tries to get `.text()` from the DOM before the full reload and it times out. ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have a helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have a helpful link attached, see `contributing.md` ## Documentation / Examples - [ ] Make sure the linting passes by running `pnpm lint` - [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md) -
Shu Ding authored
In the server layer, we used to alias `react` to the resolved path e.g. `/next.js/node_modules/.pnpm/react@0.0.0-experimental-e6a062bd2-20220913/node_modules/react`, but it turns out that webpack's enhanced resolver can't handle it correctly together with conditions, and the final resolved path is `/next.js/node_modules/.pnpm/react@0.0.0-experimental-e6a062bd2-20220913/node_modules/react/index.js`. If we change the alias to `react: 'react-exp'` then it correctly resolves to `/next.js/node_modules/.pnpm/react@0.0.0-experimental-e6a062bd2-20220913/node_modules/react/react.shared-subset.js`. ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have a helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have a helpful link attached, see `contributing.md` ## Documentation / Examples - [ ] Make sure the linting passes by running `pnpm lint` - [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
-
Tim Neutkens authored
-
JJ Kasper authored
-
JJ Kasper authored
This keeps the necessary config for release stats for app dir x-ref: https://github.com/vercel/next.js/pull/40776 Fixes: https://github.com/vercel/next.js/actions/runs/3102008544/jobs/5025346767
-
Tomer Aberbach authored
Fixes #40463 Could use some help figuring out where to add a test! I looked around and found [`jest-next-swc.test.ts`](https://github.com/vercel/next.js/blob/canary/test/unit/jest-next-swc.test.ts), but I don't think I can use that to test this fix. Anyways, from my local testing this PR seems to fix the issue. Co-authored-by:
JJ Kasper <jj@jjsweb.site>
-
Hannes Bornö authored
For some context: [https://vercel.slack.com/archives/CGU8HUTUH/p1662124179102509](https://vercel.slack.com/archives/CGU8HUTUH/p1662124179102509) Continuation of #40221 and #40227 Adds `experimental.fontLoaders`. SWC next-font-loaders (#40221) transforms font loader (e.g. #40227) call expressions into an import with the function call arguments as a query. The imports will be matched by `next-font-loader`. It runs the configured font loaders - emits font files and returns CSS. Exports are added, and the font-family is made locally scoped. The returned CSS is turned into a CSS module with `css-loader` which lets you consume the font-family. `FontLoaderManifestPlugin` creates a manifest of the preloaded font files for each entrypoint. Preload/preconnect are then added in `_document.tsx` if any font files were found for that path. Co-authored-by:
JJ Kasper <jj@jjsweb.site>
-
Anthony Shew authored
## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have a helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have a helpful link attached, see `contributing.md` ## Documentation / Examples - [ ] Make sure the linting passes by running `pnpm lint` - [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
-
JJ Kasper authored
-
Jiachi Liu authored
For app edge SSR, we don't need any internal pages for it since it's handled by app-renderer. This results around reducing 20KB from app edge SSR # Changes * Strip those internal pages modules when it's in app edge SSR * Minimize edge SSR chunk to see the tree-shake result * Add bundle analyzer with switcher in stats-app for testing. Using `TEST_ANAYLYSE=1` to build stats-app for testing
-
- 21 Sep, 2022 13 commits
-
-
Henrik Wenz authored
## Changes - Updated dependencies - Migrated to Typescript - Added additional router use cases ## Documentation / Examples - [x] Make sure the linting passes by running `pnpm lint` - [x] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
-
JJ Kasper authored
New scoped packages need to be initialized as public so this adds the `publishConfig` for this. Fixes: https://github.com/vercel/next.js/actions/runs/3101494786/jobs/5023375720
-
Balázs Orbán authored
Closes #40775 <!-- Thanks for opening a PR! Your contribution is much appreciated. To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change that you're making: --> ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have a helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have a helpful link attached, see `contributing.md` ## Documentation / Examples - [ ] Make sure the linting passes by running `pnpm lint` - [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
-
JJ Kasper authored
-
Hannes Bornö authored
For some context: https://vercel.slack.com/archives/CGU8HUTUH/p1662124179102509 Adds `@next/font` package. `scripts/update-google-fonts.js` generates functions and metadata for all available google fonts. The metadata is used in `loader.ts` to validate font options (from #40221). It then fetches the CSS from google fonts, downloads the font files and emits them as static assets. The actual integration with `packages/next` and integration tests depends on #40221, will follow up with new PR. Co-authored-by:
JJ Kasper <jj@jjsweb.site>
-
Hannes Bornö authored
For some context: https://vercel.slack.com/archives/CGU8HUTUH/p1662124179102509 Transforms call expressions of imported functions, only affects imports specified in SWC options. Each argument is turned into JSON and appended to the import as a query. The query can be read in a webpack loader, i.e. the call expression is only evaluated at build time ### Transform From ```tsx import { Fn } from "package" const res = Fn(1, "2", { three: true }) ``` To ```tsx import res from 'package?Fn;1;"2";{"three":true}' ``` ### Visitors #### NextFontLoaders (mod.rs) Creates several visitors that updates the state and reports errors. This is where the AST is mutated. After all other visitors are done the call expressions and original imports are removed. The newly generated imports are added instead. #### FontFunctionsCollector Finds imports from the specified packages. Function calls of these imports should be transformed. #### FontImportsGenerator Creates import declarations, call expression arguments are turned into JSON and added to the import as a query. #### FindFunctionsOutsideModuleScope Makes sure that there's no reference of the functions anywhere else but the module scope. Co-authored-by:
JJ Kasper <jj@jjsweb.site>
-
Shu Ding authored
`config.experimental.serverComponents` is currently required to be enabled or disabled together with `config.experimental.appDir` (which means `serverComponents === appDir` otherwise it will throw) so there is no reason to keep both of them. This PR removes `serverComponents` from Next.js and only rely on `appDir` instead. ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have a helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have a helpful link attached, see `contributing.md` ## Documentation / Examples - [ ] Make sure the linting passes by running `pnpm lint` - [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
-
Shu Ding authored
This PR changes the external module resolution to eagerly bundle node_modules, and some specific Next.js internal modules, if on the `WEBPACK_LAYERS.server` layer. While resolving corresponding packages, we use the `react-server` export condition (fallbacks to default). A follow-up PR will be adding a Next.js option to opt-out specific packages from being bundled on the server layer. ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have a helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [x] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have a helpful link attached, see `contributing.md` ## Documentation / Examples - [ ] Make sure the linting passes by running `pnpm lint` - [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
-
JJ Kasper authored
This adds a test case verifying client transitions to `/404` or `/_error` are working properly. Test deployment with patched reproduction can be seen here https://router-bug-repro-4bozmev4p-ijjk-testing.vercel.app/blocked Closes: https://github.com/vercel/next.js/issues/40667
-
Henrik Wenz authored
## Documentation / Examples - [x] Make sure the linting passes by running `pnpm lint` - [x] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
-
Henrik Wenz authored
## Changes see commits ## Documentation / Examples - [x] Make sure the linting passes by running `pnpm lint` - [x] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
-
Rishabh Poddar authored
- Updates supertokens-node and supertokens-auth-react dependencies. - Uses separate Email verification recipe instead of using it inside the ThirdPartyEmailPassword recipe (as per the update) - Uses <SessionAuth> guard instead of <ThirdPartyEmailPassword> guard (as per the lib update)
-
Shu Ding authored
I have next-swc compiled locally inside the folder so there're a lot of files there (totally unexpected). And then the `fs.copy` takes 28433 ms... by filtering it out it's only 1s. ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have a helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have a helpful link attached, see `contributing.md` ## Documentation / Examples - [ ] Make sure the linting passes by running `pnpm lint` - [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
-