Sorry, but we couldn't locate the page you were looking for. The robots.txt file seems

Hey there everyone, I'm currently working with Nuxt3 and encountering an error when trying to access the robot.txt file.

Here's the Robot.txt module that I've integrated.

Within my nuxt.config.ts file:

export default defineNuxtConfig({
    imports: {
        autoImport: true
    },

    modules: [
        '@unocss/nuxt',
        '@nuxtjs/robots',
    ],

    robots: {
        UserAgent: '*',
        Disallow: ''
    }
})

Following that, I executed the generate and preview scripts from my package.json file.

Here's a snippet from my package.json file:

{
  "private": true,
  "scripts": {
    "build": "nuxt build",
    "dev": "nuxt dev",
    "generate": "nuxt generate",
    "preview": "nuxt preview",
    "postinstall": "nuxt prepare"
  },
  "devDependencies": {
    "@iconify/json": "^2.1.112",
    "@unocss/nuxt": "^0.45.22",
    "nuxt": "3.0.0-rc.11"
  },
  "dependencies": {
    "@nuxtjs/robots": "^2.5.0"
  }
}

Upon running the preview command/script, the terminal displays INFO: Accepting connections at http://localhost:3000.

However, clicking on the provided address opens the app in the browser, whereas navigating to http://localhost:3000/robot.txt results in a redirect to a 404 page.

Answer №1

When working with nuxt 3, it is recommended to utilize nuxtjs/[email protected]

For instance:

npm install @nuxtjs/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="20524f424f545360130e100e10">[email protected]</a>

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

Tips on finding the key associated with a specific value

When a form is submitted, one of the fields being sent is an ID number instead of the name for easier processing by the server. For example: HTML dropdown select <select ng-model="myColor" class="form-control" ng-options = "color.ID as color.color ...

Next.js deployments on Vercel are encountering issues with resolving local fonts

Currently, I am facing an issue while trying to incorporate next/fonts into my project in next.js 13.3. The setup works perfectly on my local machine, but as soon as I deploy it to Vercel, a build error arises with the message Module not found: Can't ...

Verify the content of each file in a bulk upload before transferring them to the server

I am facing an issue with a form that has 3 separate file input fields. I need to validate their MIME types individually before uploading them to the server. The first two should only allow MP3 files, while the last one should only allow JPEG files. Is th ...

Modifying the $locale setting in ui-router

My Goal and Approach Within our AngularJS application, we utilize angular-ui-bootstrap for datepickers. Our aim is to localize the datepickers based on the user's locale. However, dynamically changing the locale in AngularJS poses a challenge due to ...

Optimizing Vue.js performance - tracking the re-rendering of my components

Currently, I am in the process of developing a PWA using vue.js and one issue I encounter is the excessive re-rendering of components leading to slow performance at times. Initially, my plan was to insert some console.log statements within the mounted and ...

Unable to change placeholder in Material UI's Select Form

I'm having trouble modifying my SelectionForm. I need to update the color of the placeHolder image from red to a different color, but I can't find any properties or props on the material ui Docs to do so. Can someone assist me with this? https:/ ...

Displaying stack traces in a request using HttpInterceptor in Angular 9

I have created an HttpInterceptor and I would like to print the stack trace of the functions involved in making the request for development purposes: import { Injectable } from '@angular/core'; import { HttpRequest, HttpHandler, HttpEvent, ...

Display or conceal div based on chosen options

I am working on a feature that involves three dropdown select boxes, each containing different sets of demographic attributes. My goal is to show a score based on the combination of selections made by the user. For example, if a user chooses Male, 18-24, A ...

React Timer App: The setInterval function is being reset after each render operation

I'm currently working on a straightforward timer application that will begin counting seconds when a button is clicked. To implement this, I am utilizing react hooks. import React, { useState } from 'react' function Timer() { const [sec ...

Ways to remove a JSON item based on its index position?

In my JSON object, I am trying to find a way to remove the first element. Here is an example of what I have: var obj1 = {property:'something', does:'somethingElse', is:'somethingCool'}; var obj2 = {does:'somethingElse&ap ...

Loop through the JSON data to obtain distinct values for certain indices

My PHP script retrieves data with the following query: SELECT objective,signal_type,signal_name FROM signals WHERE channel="Email" This is how the data is returned: [ { "objective": "Awareness", "signal_type": "Efficiency", " ...

Updating a specific row in a multiple row form can be achieved when the input field names match in a column

My task involves working with a report that generates a form in input mode. This form contains multiple rows of data, each row consisting of a button and an input field. The input field name remains consistent across all rows for easier processing by the C ...

Having trouble with Vue CLI installation?

Trying to set up the Vue CLI by running the command npm install -g @vue/cli. Here's the feedback displayed in the terminal: npm WARN deprecated @hapi/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="dcacbbb4bbb6f0bfb0bfb7"& ...

trigger the eventHub within a Vuex store

I'm trying to figure out how I can utilize this.$eventHub.$emit('something'); within vuex. The reason I need this is because I'm using a plugin called vuex-persist-indexeddb, which has a method called rehydrated that fires when the data ...

Change to JSONArray using angularjs

Here is a json object: "values": [ {"name": "name1"}, {"name": "name2"}, {"name": "name3"} ] I want to convert it into this format: values: ["name1", "name2", "name3"]; Can this conversion be done in AngularJS or any other JavaScript functi ...

Unexpected behavior encountered in Rails app with unobtrusive JavaScript

I'm facing an issue with my link_to setup. Here's what I have: <%= link_to "Load More", comments_feed_path(@post.id), :id => 'my-link', :remote => true %> In my application.js file, I have the following code: $( document ...

Utilizing imported components to set state in React

In my project, I created a functional component named Age and imported it into another functional component called Signup. This was done in order to dynamically display different divs on a single page based on the authentication status of the user. By sett ...

React encountered an issue: each child element within a list must be assigned a unique "key" prop

I am feeling a bit puzzled as to why I keep getting the error message: child in a list should have a unique "key" prop. In my SearchFilterCategory component, I have made sure to add a key for each list item using a unique id. Can you help me figu ...

What is the best way to target specific text within the DOM without including text within attributes?

We are currently displaying search results from various posts on our website, and we would like to highlight the search terms in the displayed content. Currently, we are implementing this functionality on the backend using PHP. We iterate through the post ...

Error: Unexpected token '<' encountered in Ajax request with status code 200

While attempting to run an ajax request, I keep encountering the error message 'Syntax Error: unexpected token <' along with a xhr.status of 200. Strangely, I am able to successfully email the variable passed from the JavaScript file to the PH ...