Skip to content

Commit

Permalink
Merge branch 'main' into fix/block-trace-url
Browse files Browse the repository at this point in the history
  • Loading branch information
kodiakhq[bot] authored Mar 21, 2022
2 parents a09ab79 + e441c97 commit f25643e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/helpers/functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { NetlifyConfig, NetlifyPluginConstants } from '@netlify/build'
import bridgeFile from '@vercel/node-bridge'
import { copyFile, ensureDir, writeFile, writeJSON } from 'fs-extra'
import type { ImageConfigComplete } from 'next/dist/server/image-config'
import { join, relative } from 'pathe'
import { join, relative, resolve } from 'pathe'

import { HANDLER_FUNCTION_NAME, ODB_FUNCTION_NAME, IMAGE_FUNCTION_NAME, DEFAULT_FUNCTIONS_SRC } from '../constants'
import { getHandler } from '../templates/getHandler'
Expand All @@ -14,7 +14,7 @@ export const generateFunctions = async (
): Promise<void> => {
const functionsDir = INTERNAL_FUNCTIONS_SRC || FUNCTIONS_SRC
const functionDir = join(process.cwd(), functionsDir, HANDLER_FUNCTION_NAME)
const publishDir = relative(functionDir, join(process.cwd(), PUBLISH_DIR))
const publishDir = relative(functionDir, resolve(PUBLISH_DIR))

const writeHandler = async (func: string, isODB: boolean) => {
const handlerSource = await getHandler({ isODB, publishDir, appDir: relative(functionDir, appDir) })
Expand Down
7 changes: 2 additions & 5 deletions src/helpers/verification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,7 @@ export const checkNextSiteHasBuilt = ({
: `In most cases it should be set to ".next", unless you have chosen a custom "distDir" in your Next config.`

return failBuild(outdent`
The directory "${path.relative(
process.cwd(),
publish,
)}" does not contain a Next.js production build. Perhaps the build command was not run, or you specified the wrong publish directory.
The directory "${publish}" does not contain a Next.js production build. Perhaps the build command was not run, or you specified the wrong publish directory.
${outWarning}
If you are using "next export" then you should set the environment variable NETLIFY_NEXT_PLUGIN_SKIP to "true".
`)
Expand All @@ -93,7 +90,7 @@ export const checkForRootPublish = ({
}): void | never => {
if (path.resolve(publish) === path.resolve('.')) {
failBuild(outdent`
Your publish directory is pointing to the base directory of your site. This is not supported for Next.js sites, and is probably a mistake.
Your publish directory is pointing to the base directory of your site. This is not supported for Next.js sites, and is probably a mistake.
In most cases it should be set to ".next", unless you have chosen a custom "distDir" in your Next config, or the Next site is in a subdirectory.
`)
}
Expand Down

0 comments on commit f25643e

Please sign in to comment.