SvelteKit: Issue with missing images when running npm build

This is a straightforward SvelteKit application:

<img src="static/bird.jpg" alt="a bird"/>

When I use npm run dev, the image shows up just fine. However, when I execute npm run build and then npm run preview, only the alt text appears.

What could be causing this issue? It seems similar to what is discussed in this post.

The version of SvelteKit I am using is v1.0.0-next.107

Answer №1

The answer has been discovered:

<img src="/dog.jpg" alt="a dog"/>

Route excluding dynamic.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

In order to link a package using npm, the package name must contain a specified name field

Hi there, currently I am grappling with the task of creating a docker image. A small section of my docker file is causing some trouble, and I suspect it's related to the nodejs package. The softlink in question looks like this: ls -la "/usr/bin/npm" ...

What to do when nodeenv does not link grunt after being installed using npm install -g?

When using nodeenv, I am facing an issue where binaries are not getting linked for npm installed modules. $ mkvirtualenv venv (venv)$ pip install nodeenv (venv)$ nodeenv -p (venv)$ deactivate $ workon venv (venv)$ which grunt /usr/local/bin/grunt (venv)$ ...

Issue: The program located at `C:Program Files (x86)Microsoft Visual Studio2017BuildToolsMSBuild15.0BinMSBuild.exe` encountered an error and terminated with exit code 1

While attempting to install all dependencies using the npm install command, an error arose during installation. The error message is as follows: Warning C4996: 'node::MakeCallback' was declared deprecated. Upon encountering this issue, various ...

Travis encounters issues deploying Firebase with a script due to an unsupported environment and the fsevents Darwin error

Currently in the process of upgrading my Travis environment to node 20, where I am running a script that deploys Firebase functions. Below is my .travis.yml file: ... install: bash $HOME/build/ChangEdApps/changed-javascript/backend/shellScripts/travis-scr ...

Systemd Debian Autorun Service: Optimizing Your System Startup

I've been working on a node.js App. Currently, in the directory (/var/lib/cloud9/BBB_WebApp$), there's a package.json: { "name": "MCP", "version": "0.0.0", "private": true, " ...

Deploying a Node.js app on Heroku using a Mac has hit a roadblock - encountering the error message "sh: 1: nodemon: not found" along with "npm ERR! `nodemon fileName.js

Guide to Deploying on Heroku with Node.js using Mac Encountered Problem: Error message: State changed from starting to crashed && sh: 1: nodemon: not found && Failed at...start script && status 1...code=H10 After developing my ...

Having trouble getting the convert-multiple-files npm package to function properly on an Elastic Beanstalk environment running Amazon Linux

Following a successful deployment, I encountered an issue with my file conversion script when attempting to convert files as outlined in the documentation. The script works flawlessly on both a local Windows 10 machine and Ubuntu 20.04 LTS. const { conv ...

Are there any available nodejs libraries specifically designed for converting epub files into pdf format?

Currently, I am working on developing a telegram bot using nodejs to convert epub files to pdf. However, I have been unable to locate any npm module that can assist with this task. Is there anyone familiar with a module capable of taking an epub file as i ...

Building an NPM module specifically designed for Ionic app development requires a strategic approach

Currently, I am in the process of creating a library for Ionic 2 that needs to be installed via NPM. However, I am facing some challenges with the traditional installation method. When trying to develop a module, you can usually use the npm link command to ...

Why is TypeScript unable to recognize package exports? (using CommonJS as the module system and Node as the module resolution)

I have an NPM package that is built for ESM and CJS formats. The package has a dist folder in the root directory, which contains: dist/esm - modules with ESM dist/cjs - modules with CJS dist/types - typings for all modules In the package.json file, there ...

Error executing generateservertestreport script in npm run script

While executing an npm script through a TFS build, I encounter an issue. However, running the same script directly on the TFS build machine does not show any errors. Note: My node version is 8.12.0 and npm version is 6.4.1 Despite researching the cause o ...

It has been quite the challenge trying to integrate Argon2 with Angular 8 on MacOS, as it seems completely non-functional at the

I am currently using: MacOS Mojave Angular 8 node v12.12.0 npm v6.13.4 and attempting to implement Argon2 in my Angular 8 application. To utilize Argon2, it is necessary to globally install gcc and node-gyp. I followed the instructions on Argon2's ...

One of the Amplify and AWS files that seems to be missing is the "aws-exports" module

Recently, a company interested in hiring me sent over a "trial project" to work on. It was supposed to be simple, but it required the use of Amplify and AWS. The CTO specified that I needed to have a specific version of Node (10.18.1 or 10.19.0) and instru ...

Ways to terminate a running child process in npm

Within my package.json file, I have a debug script that launches a Node application. This entire NPM script is initiated by a test, and this test must terminate the debug script once it completes. When I use npm run debug and try to kill the process, the ...

What could be causing the failure of this build when NODE_ENV is configured for production?

I encountered an issue where the npm install command was not functioning properly when the NODE_ENV variable was set to production. Since my knowledge of Node is limited, I am reaching out for help to understand why this problem might be occurring. Here a ...

issue encountered while attempting to install oracledb using npm

When attempting to install node oracledb on Windows 7, I encountered an error message. Here is a screenshot of the error: npm install oracledb I diligently followed all the steps outlined in this tutorial Installing node-oracledb on Microsoft Windows, but ...

Encountering difficulties during the installation of tensorflow.js using npm

I attempted to install the necessary package using the command provided in the tensorflow documentation: npm install -g @tensorflow/tfjs-node Despite my best efforts, I have been unable to identify a solution to the problem. Any assistance in resolving th ...

Encountering an error while attempting to generate a fresh Ionic 3 project. npm reports the following issue: "npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] postinstall

Today has been a rough day as I attempt to start a new project in Ionic 3. The versions of software I am using are as follows: Ionic 3.9.2 npm 6.7.0 node v8.10.0 Operating on Ubuntu 18, each time I run the following command: sudo ionic start test blank ...

Setting custom parameters ($npm_config_) for npm scripts on Windows allows for more flexibility and customization in

I'm struggling with passing custom parameters from the command line to npm scripts in my package.json file. Despite researching on various platforms, including Stack Overflow, I haven't found a solution that works for me. Here's what I' ...

"Troubleshooting: Issue with updating page CSS in browser when using npm, node-sass, and concurrent in an

Embarking on a new Angular2 project to enhance my skills, I've made the decision to avoid Yeoman Generator and tools like Grunt or Gulp due to the software still being in development. Instead, I'm utilizing the Node Package Manager to run automat ...