gulp-webpack encountered an error: The entry module could not be found. Error: module resolution failed

Whenever I attempt to run gulp scripts, it gives me the following error message:

ERROR: Entry module not found

Error: Unable to resolve 'C:/Users/milan/Local Sites/project-university/app/public/wp-content/themes/fictional-university-theme/js/scripts.js' in 'C:\Users\milan\Local Sites\project-university\app\public'

Here is my webpack.config.js:

const path = require('path'),
settings = require('./settings');

module.exports = {
  entry: {
    App:   settings.themeLocation + "js/scripts.js"
  },
  output: {
    path: path.resolve(__dirname, settings.themeLocation + "js"),
    filename: "scripts-bundled.js"
  },
  module: {
    rules: [
      {
        test: /\.js$/,
        exclude: /node_modules/,
        use: {
          loader: 'babel-loader',
          options: {
            presets: ['@babel/preset-env']
          }
        }
      }
    ]
  },
  mode: 'development'
}

And here is my settings.js:

exports.urlToPreview = 'http://project-university.local/';

exports.themeLocation = 

'C:/Users/milan/Local Sites/project-university/app/public/wp-content/themes/fictional-university-theme/';

Below, you can see my file directory:

Project---- app------ public----------(wordpress content files)

Answer №1

An issue arises with the compilation path specified in settings.js. To resolve this, the path defined should be updated as follows:

exports.themeLocation = './wp-content/themes/fictional-university-theme/';

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

Deployment to Azure using a .json file extension

We are in the process of deploying an Azure package that includes a static .json file. Although we have successfully tested it in the Azure emulator and locally, we encounter an issue when running it on Azure. The application seems to keep spinning and w ...

What could be causing html-webpack-inline-source-plugin to prevent the page from refreshing after editing CSS files?

Currently, I am utilizing a plugin that embeds all CSS within the final HTML file. This method prevents the application from refreshing in development mode. Whenever I make edits to the CSS, the build process completes normally, but the styles do not updat ...

Exploring ways to extract a specific value from a JSON file using grep?

I am facing a challenge with my JSON file and its content which looks like this: [ { "id":"54545-f919-4b0f-930c-0117d6e6c987", "name":"Inventory_Groups", "path":"/Groups", "subGroups":[ { ...

Ways to remove specific characters from the escape() function in express-validators

When using the check method from express-validator to validate user input, I'm curious if there's a way to exclude certain characters from the test. For example, currently I have: check("profile.about").trim().escape() This code snippet convert ...

Best practice for structuring a JSON payload and sending it to a server using Volley

Currently, I am working on implementing the Safe Browsing API by Google to verify if a web link is blacklisted. To achieve this, I need to send a request within a JSON object to the following endpoint: POST https://safebrowsing.googleapis.com/v4/threatMat ...

Adding a Stripe pay button using Jquery append results in the return of an [object HTMLScriptElement

I'm currently working on dynamically adding the Stripe pay with card button through jQuery. I've decided to append it because I only want it to show up once a specific condition is met by the user, as well as due to the fact that the pricing can ...

Troubleshooting a jQuery localization problem in a .NET 4.5 Control

Currently, I am facing an issue with a .NET 4.5 .ascx control that renders HTML along with a jQuery script on the client page. I am in the process of localizing the website to support multiple languages, and I have encountered some strange behavior specifi ...

Can you provide steps on converting a Facebook response into a JSON formatted string?

I'm attempting to receive query responses from Facebook and match them to a user-defined class: Here is the class structure I have: class FBStory { @Field private String application_id; @Field private String applicati ...

Using React, we can create a component by defining it as a constant and then

Currently, I have a React component that is created as a const and takes props. In another file, there is a function called selectChanged() {} which returns undefined every time the select value is changed. The code for the component is as follows: ... ...

Utilizing handpicked information in Angular: A beginner's guide

Being new to Angular and programming in general, I am currently navigating through the intricacies of Angular and could use some guidance on utilizing selected data. For instance, I would like to use a personnel number view image here and send it to the b ...

The execution of the enzyme wrapper.update() function results in the removal of the value prop from the ref input

Take a look at this Code Sandbox that showcases a test scenario related to the issue being discussed. The test in the mentioned Code Sandbox is failing as outlined in the question: https://codesandbox.io/s/react-jest-and-enzyme-testing-c7vng The goal here ...

Retrieve the direction of panning when the panning stops with hammer.js and limit the possible

I have integrated the hammer.js library along with its jQuery plugin. I followed the documentation and used the following code to initialize it on .game-card-mobile divs: /* Creating a Hammer object for swipeable game cards */ var $gameCard = $('.gam ...

Making an AJAX call to a PHP script to add data

Could you assist me in understanding why my code is resulting in a double insert? I have a JavaScript function that makes an AJAX request to a save.php file to insert data into a database. However, each time I submit it, it performs the insertion twice, al ...

DOMException: Access to property "apply" on a cross-origin object has been denied

Over the last day, I've been tackling the FreeCodeCamp assignment "quote machine". Everything is working fine except for the tweet button. You can tweet as many times as you like for one single quote, but not for multiple quotes (once you tweet one, y ...

Can existing servers support server side rendering?

I am currently working on building a Single Page Application (SPA) using the latest Angular framework. The SPA will involve a combination of static HTML pages, server side rendering, and possibly Nunjucks templating engine. My dilemma lies in the fact th ...

Error: Attempting to access nonexistent function have_posts()

Could you please point out what I may have done incorrectly in this code: $popular_posts_args = new wp_query( array( 'post_type' => 'blog', 'post_status&ap ...

Is the state of the React.js component empty?

HTML: <!-- index.html --> <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>React Tutorial</title> <script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.14.6/react.js"></script> ...

Grunt and Bower are loading a single script at the top of the page

Hey there! I'm still fairly new to this, but I've been using a yeoman generator for my projects, specifically the one found at https://github.com/DaftMonk/generator-angular-fullstack. My goal is to have Angular load at the top of the index.html i ...

Using JavaScript to Show Variables When Clicked

I have been working on populating multiple divs with data stored in variables that change when an image is clicked. Here's a snippet of the code within my tag:</p> <pre><code>function displayName(name){ document.getElementById( ...

What steps should be taken to address the issue when the .media$thumbnail.url cannot be located

Creating a custom widget for bloggers <script type="text/javascript"> function mycallback(jsonData) { for (var i = 0; i < jsonData.feed.entry.length; i++) { for (var j = 0; j < jsonData.feed.entry[i].link.length; j++) { ...