No assets detected in sails.js

Recently, I began a new sails project using 'sails new project --linker'. Initially, everything was functioning correctly but today I encountered a problem.

Every time I start the server with 'sails lift', I now receive a 404 error for all my javascript files. Upon investigation, I realized that the '.tmp/public' folder is being deleted each time the server is launched. I have not made any changes to the 'gruntfile' or any core files, and there are no errors being displayed in the console.

Answer №1

When you run sails lift, the .tmp folder is deleted every time. This folder is where Sails stores its public directory for the HTTP server.

In v0.10, linker is enabled by default, if I recall correctly.

To test this, try running sails new project without using the --linker option and check what appears in the assets/ directory. There should be a linker folder present.

If it's not there, create the folder yourself and add the necessary tags to your EJS file.

For more information specific to version 0.10, you can refer to the documentation here.

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

Having trouble globally installing express-generator using nvm

My current setup involves using NVM to bypass the need for utilizing sudo when installing global packages. This method successfully handles installations of tools like Bower and Grunt, but hits a snag when attempting to install Express Generator globally u ...

When using the UI Router, nested views may display double slashes in the URL and redirect back to

I've been working on editing a project to incorporate a root view/state that encapsulates all other views/states within it. Previously, each page functioned as an independent state, making it cumbersome to implement global changes across all states wi ...

Configuring server timeout in express.js

In my understanding of node.js, there is a configuration setting called server.timeout. Can you explain how to adjust the server timeout in express.js? ...

React: Updating useState array by removing the first element triggered by an event or timer

I am currently working on a function that populates a useState array containing objects representing cars. These cars appear on the left side of the screen and move across until they are off-screen. My goal is to remove these cars from the state array once ...

The paths specified in Node.js and Express are having difficulty finding the resource files for CSS and JavaScript

I am currently using Express to develop a basic website. Everything was running smoothly until I attempted to add the following code to handle 404 errors: app.get('/*', function(req, res) { res.render('404.ejs',{ title: ' ...

Having trouble with submitting an Ajax form to a MySQL database

My expertise lies in PHP and HTML, but I'm currently learning JavaScript. I'm facing a challenge with creating a form that can submit data to be inserted into MySQL without reloading the page (using AJAX). Here is the form I have: <form id=" ...

When Typescript and React Native Imports Clash in an Express App, Resolving the Conflict of "npm run build" Command

When running my Express app using 'npm run serve', defined as 'npm run build && node lib/index.js' in the package.json scripts serve section, I encounter multiple duplicate declaration errors after installing React Native for a ...

Change Observable<String[]> into Observable<DataType[]>

I'm currently working with an API that provides me with an Array<string> of IDs when given an original ID (one to many relationship). My goal is to make individual HTTP requests for each of these IDs in order to retrieve the associated data from ...

All Event Monitor

Is it possible to use Event Listeners in jQuery to display information when a specific word is clicked? For example, showing a definition when a word is clicked. Thanks, Adam. I need help with creating a feature where clicking on a person's name in a ...

How can I change the background color of a parent div when hovering over a child element using JavaScript

I am working on a task that involves three colored boxes within a div, each with a different color. The goal is to change the background-color of the parent div to match the color of the box being hovered over. CSS: .t1_colors { float: left; wid ...

I encountered a mapper_parsing_exception while attempting to connect Elasticsearch to my Node application using Mongosastic

Hello, I am currently working on integrating elastic search into my NodeJS project and encountering the following error: { Error: [mapper_parsing_exception] No handler for type [string] declared on field [category] status: 400, displayName: 'BadRequ ...

Is it possible to adjust the timezone settings on my GraphQL timestamp data?

I've come across a lot of helpful information regarding the usage of Date() and timezones, but something seems to be off. In my GraphQL setup (sourcing from Sanity), I have configured it to use formatString in this manner: export default function Minu ...

Issue with Bootstrap.js causing mobile menu to not expand when toggled in Rails app

Despite adding the .toggled class, my hamburger menu is not expanding when I click on the mobile menu. I've tried adjusting the order of the required javascript commands, but it doesn't seem to be working as expected. Here are the steps I'v ...

What is the best way to retrieve the final document from the elasticsearch index?

Currently, I am implementing NodeJS to retrieve the first and last document from an Elasticsearch Index. client.search({index: 'test', size: 1, sort: [{"_timestamp": {"order":"desc"}}]}, function(err, resp, status) { console.log("data", re ...

Working with HTML5 Canvas to Clip Images

Is there a way to implement a tileset image in canvas like this one? I am trying to figure out how to make it so that clicking on the first tile returns 0, clicking on the tenth tile returns 9, and so on... Any suggestions on how to clip a tileset on an ...

ExpressJS server encountering a CORS issue despite the inclusion of the CORS middleware

I am currently running a frontend and express JS server on AWS Lightsail using Ubuntu with Nginx as the host. The server is configured as a reverse proxy. Here is the configuration: location /api/ { proxy_pass http://localhost:4000/api/; proxy_http_vers ...

Encountering an issue in a Next.js application while building it, where an error is triggered because the property 'protocol' of 'window.location' cannot be destructured due to being undefined

While building my nextjs application, I encountered the following error. My setup uses typescript for building purposes, although I am only using JavaScript. Build error occurred: TypeError: Cannot destructure property 'protocol' of 'window ...

Ways to specify a setter for a current object property in JavaScript

Looking to define a setter for an existing object property in JavaScript ES6? Currently, the value is directly assigned as true, but I'm interested in achieving the same using a setter. Here's a snippet of HTML: <form #Form="ngForm" novalida ...

Is there a way to access hover effect information in Atom editor similar to how it appears in VScode?

Is there a specific plugin required in Atom to display information when hovering over variables, objects, or functions similar to intellisense? VSCode does this automatically, but I am looking for the same functionality in Atom. https://i.stack.imgur.com/ ...

How to implement a self-invoking function in React JS like you would in regular JavaScript?

Is it possible to invoke the function good without triggering it from an event? I want it to run as soon as the page loads, similar to a self-invoking JavaScript function. Check out this example import React from 'react'; class App extends Reac ...