You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't understand if this an issue with Next-Drupal or with Next 14, but since this is a library that aims to work with Next.js as-is I'll first open the issue here.
I'm trying to build a static export with Next 14 (the output property of next.config.js is set to export), but when I include the getMenu method in my code, the Next build silently fails to produce the html templates of the pages (including index.html).
From Next 13 similar issues have been linked with the built-in image optimization of Next.js, but in this project I set the unoptmized flag to true for the images property in next.config.js and the issue still happens if and only if the getMenu method is invoked.
If I replace the getMenu method with something like this the build finishes with the expected result (note that I don't need token authorization so I left it out):
async function getMenu(name: string) {
const url = drupal.buildUrl(`/jsonapi/menu_items/${name}`)
const response = await fetch(url.toString())
const serialized = await response.json()
const items = drupal.deserialize(serialized) as DrupalMenuLinkContent[]
const { items: tree } = drupal.buildMenuTree(items)
return { items, tree: tree as DrupalMenuLinkContent[] }
}
Expected behavior
I build the Next project with the static output options set to true and the created out folder contains the html files for index.html and all the pages.
Steps to reproduce:
use the getMenu method in a reachable part of the code
set the output property to export in the next.config.js file
launch the build command
check the contents of the out folder for the static html files
the html files aren't there (including no index.html)
The text was updated successfully, but these errors were encountered:
Package containing the bug
next (Drupal module)
Describe the bug
I don't understand if this an issue with Next-Drupal or with Next 14, but since this is a library that aims to work with Next.js as-is I'll first open the issue here.
I'm trying to build a static export with Next 14 (the output property of next.config.js is set to
export
), but when I include thegetMenu
method in my code, the Next build silently fails to produce the html templates of the pages (including index.html).From Next 13 similar issues have been linked with the built-in image optimization of Next.js, but in this project I set the
unoptmized
flag to true for the images property in next.config.js and the issue still happens if and only if the getMenu method is invoked.If I replace the getMenu method with something like this the build finishes with the expected result (note that I don't need token authorization so I left it out):
Expected behavior
I build the Next project with the static output options set to true and the created out folder contains the html files for index.html and all the pages.
Steps to reproduce:
output
property toexport
in thenext.config.js
fileout
folder for the static html filesindex.html
)The text was updated successfully, but these errors were encountered: