Muse
Muse
NNuxt
Created by Muse on 8/16/2024 in #❓・help
Build script and then inject into <head>
I have a .ts file that contains an import statement to use a function from a third-party package. This script needs to be compiled and then loaded as close to the top of the <head> as possible. Is there an existing way to do this easily in Nuxt 3? I'm also open to other alternatives that are equivalent to loading the script inside <head> without necessarily putting it there, e.g. calling the function inside that .ts file in a hook somewhere? This is used for monitoring page performance so the browser agent needs to run as early as possible.
1 replies
NNuxt
Created by Muse on 5/13/2024 in #❓・help
Deployed Nuxt app is frozen
I deployed a Nuxt app that was built using the generate command using GitHub Actions, S3, and CloudFront. It was working fine before but for some reason in the last deployment when I visit the site, I only see a white screen. I can't right-click anywhere and sometimes the browser would show a prompt that the page is unresponsive. There are no errors in the build. I tried to build the app locally and the same thing happens, frozen white screen. Any hints as to what could be causing this?
5 replies
NNuxt
Created by Muse on 7/4/2023 in #❓・help
Where should I put a global stateless helper function?
If I need to create a simple function to build the base path of my application, which makes it necessary to be accessible throughout the whole application, where would it be most suitable? In the /plugins or /utils folder? Do I define it as a new plugin? Something like:
export const buildBasePath = () => { return `my/app/`; };
export const buildBasePath = () => { return `my/app/`; };
And then I will call this inside the script tags to construct URLs and programmatically navigate to other pages.
1 replies