Skip to content

Commit 8982ab6

Browse files
committed
fix: needing to check if nodemodule first
1 parent a2a1ded commit 8982ab6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/runtime/src/helpers/functions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ export interface ApiRouteConfig {
3535
const checkForPackage = async (packageDir: string, nodeModule: boolean) => {
3636
const packagePlugin = existsSync(packageDir) ? await readJSON(packageDir) : null
3737
const nextPlugin =
38-
packagePlugin?.dependencies[NEXT_PLUGIN] && !nodeModule ? packagePlugin.dependencies[NEXT_PLUGIN] : null
39-
const checkModule = packagePlugin?.version && nodeModule ? packagePlugin.version : null
38+
!nodeModule && packagePlugin.dependencies[NEXT_PLUGIN] ? packagePlugin.dependencies[NEXT_PLUGIN] : null
39+
const checkModule = nodeModule && packagePlugin?.version ? packagePlugin.version : null
4040

4141
return checkModule || nextPlugin
4242
}

0 commit comments

Comments
 (0)