fix(nextjs-sdk): ensure nextjs sdk runs on next 15 #81

This commit is contained in:
Carl-Gerhard Lindesvärd
2024-11-16 21:38:47 +01:00
parent 13f0c29fe3
commit cc983b3f62
4 changed files with 9 additions and 7 deletions

View File

@@ -1,4 +1,6 @@
import { NextResponse } from 'next/server';
// adding .js next/script import fixes an issues
// with esm and nextjs (when using pages dir)
import { NextResponse } from 'next/server.js';
export function createNextRouteHandler({
apiUrl = 'https://api.openpanel.dev',

View File

@@ -1,4 +1,6 @@
import Script from 'next/script';
// adding .js next/script import fixes an issues
// with esm and nextjs (when using pages dir)
import Script from 'next/script.js';
import React from 'react';
import type {

View File

@@ -10,9 +10,9 @@
"@openpanel/web": "1.0.1-local"
},
"peerDependencies": {
"next": "^12.0.0 || ^13.0.0 || ^14.0.0",
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
"next": "^12.0.0 || ^13.0.0 || ^14.0.0 || ^15.0.0",
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
},
"devDependencies": {
"@openpanel/tsconfig": "workspace:*",

View File

@@ -149,8 +149,6 @@ const updatePackageJsonForRelease = (
),
};
if (name === '@openpanel/nextjs') delete newPkgJson.type;
savePackageJson(workspacePath(`${localPath}/package.json`), newPkgJson);
packages[name]!.dependencies = newPkgJson.dependencies;
};