Skip to content

Commit

Permalink
fix: erreur sur le replaceAll sur les anciens navigateurs (#6287)
Browse files Browse the repository at this point in the history
  • Loading branch information
m-maillot authored Nov 13, 2024
1 parent 2bbf0ab commit fc8b363
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/code-du-travail-frontend/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { Metadata } from "next/types";
import { SITE_URL } from "../src/config";
import { headers } from "next/headers";
import { MatomoAnalytics } from "../src/modules/config/MatomoAnalytics";
import { PolyfillComponent } from "../src/modules/utils";

export const metadata: Metadata = {
title: {
Expand Down Expand Up @@ -53,6 +54,7 @@ export default function RootLayout({
/>
</head>
<body>
<PolyfillComponent />
<DsfrProvider lang={lang}>{children}</DsfrProvider>
<MatomoAnalytics />
</body>
Expand Down
1 change: 1 addition & 0 deletions packages/code-du-travail-frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"@socialgouv/matomo-next": "^1.6.1",
"@socialgouv/modeles-social": "workspace:^",
"@socialgouv/reference-article": "^1.0.1",
"core-js": "^3.39.0",
"cors": "^2.8.5",
"date-fns": "^2.22.1",
"debounce-promise": "^3.1.2",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
This component is used to inject the polyfill replace-all for pandacss
See PR : https://github.com/chakra-ui/panda/pull/2607#issuecomment-2209389462
See issue : https://github.com/vercel/next.js/discussions/20992
*/
"use client";

import "core-js/features/string/replace-all";

export const PolyfillComponent = () => {
return <></>;
};
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export * from "./sort";
export * from "./events";
export * from "./PolyfillComponent";
8 changes: 8 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1902,6 +1902,7 @@ __metadata:
"@types/debounce-promise": ^3.1.4
"@types/jest": ^29.5.12
"@types/xml2js": ^0.4.14
core-js: ^3.39.0
cors: ^2.8.5
cypress: ^13.13.2
cypress-html-validate: ^6.1.0
Expand Down Expand Up @@ -10869,6 +10870,13 @@ __metadata:
languageName: node
linkType: hard

"core-js@npm:^3.39.0":
version: 3.39.0
resolution: "core-js@npm:3.39.0"
checksum: 7a3670e9a2a89e0a049daa288d742d09f6e16d27a8945c5e2ef6fc45dc57e5c4bc5db589da05947486f54ae978d14cf27bd3fb1db0b9907000a611e8af37355b
languageName: node
linkType: hard

"core-util-is@npm:1.0.2":
version: 1.0.2
resolution: "core-util-is@npm:1.0.2"
Expand Down

0 comments on commit fc8b363

Please sign in to comment.