Obscure issue encountered during production: `Type Error: e is not defined`

After putting my Vue app into production, I encountered a perplexing issue with a specific component that throws an error message I can't track down. The problem seems to be related to the bundling process since it only occurs in production mode.

Steps to reproduce

To replicate the issue, follow these steps in production mode:

  • Visit the deployed app on Netlify at
  • Navigate to the "Sign up" form and create a fake account
  • Use the created credentials to log in at the login page
  • Open the console
  • Go to the world and click on the "Explore Monokai" button

These steps should lead you to the problematic route/component (grandquest.netlify.com/map)

The details

  • In development mode, the app runs smoothly. However, in production mode, I encounter an error: Type Error: e is undefined (specifically in Mozilla Firefox). This occurs when I access a particular route.

  • In the build logs from vue-cli, there are warnings regarding file size limits, as shown below:

    warning  

    asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
    This can impact web performance.
    Assets: 
    img/gold-frame.536f6ce1.png (415 KiB)
    media/combat-fail.f73de150.mp3 (317 KiB)
    ...
    
      // More warnings

    DONE  Build complete. The dist directory is ready to be deployed.

Based on these observations, I suspect the issue stems from a bundling error

-

I've searched for the variable name e in my code, assuming it might be an event, but couldn't find any instances of it. It appears to be a variable abstracted by Vue.

Considering the ambiguous nature of this error, I've summarized the relevant code for the Map component. If sharing the complete files would help resolve the issue, I'm open to doing so, although the e variable doesn't appear to exist.

@/views/Map.vue

<template>
<div>
    <!-- LOADING SCREEN -->
    ...
    ...
    // Code snippet continued
</script>

<p></p>

<p>@/game/places/map.ts</p>

<pre><code>export default () => {
let game: any = null;

let global = {
  tooltip: {},
  chosenShop: null,
  gameInitialized: false,
  pointer: { x: 0, y: 0, hovering: false },
  launch() {
    ...
    // Game logic implementation
};

Expected output

You should see a loading screen followed by the map display where you can navigate and interact with various elements.

Actual output

Instead of the expected behavior, the app gets stuck indefinitely during loading due to an error. The console shows a Type error: e is undefined (on Firefox).

Any assistance in resolving this issue would be greatly appreciated :)

Answer №1

Is this specific function available?

v-on:resize="resizeMonitor"

I have searched extensively but cannot find any reference to it. It is possible that an error may occur if the function does not actually exist.

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

Transform the string response in a websocket message into JSON format

When receiving a websocket message, I often encounter a response in the form of a string like this: odds.1:[{"id":1,"marketType":10,"name":"Double chance","status":"HandedOver","specifiers":"","Outcomes":[]},{"id":2,"marketType":11,"name":"Draw no bet", ...

"Modifications made to Magento's JavaScript and CSS are not showing up

Recently, I encountered an issue where I added custom JavaScript code and it appeared to be included, but when I made changes to the content, it didn't seem to have any effect. It continued running the older JavaScript file despite clearing the cache ...

When the radio button is selected, show a variety of buttons

I'm facing an issue with rendering different buttons for two radio buttons within a view. Here is the rendered HTML code for the radio buttons: <input checked="checked" id="Isattending_0" name="Isattending" type="radio" value="Yes" /> <inpu ...

Execute a PHP function when a post is clicked using JavaScript

I have a script that shows an image depending on database results. When a user clicks the image, it changes to a new one. The green_star signifies that both $user_id and $thedb_id are in the database, while the grey_star indicates they are not. I want to b ...

Lazy loading images without the need to manually adjust the image structure

After experimenting with various LazyLoad options, I found that most of them required modifications to the src tag or the addition of a new tag. Is there a way to LazyLoad content without having to change the tag structure? I am extracting content fro ...

What is the best way to retrieve an array within a list using React.JS and Typescript?

Imagine there is an array represented by the variable list: let list = [ { id: '1', ]; Now, when a certain function is executed, the expected outcome should transform the array into this format: result = [ { id: '6', }, ] ...

Encountering an error: "SyntaxError: Identifier 'createApp' has already been declared" while trying to open Vue 3 within a Bootstrap modal

Upon loading page2 with Vue in a bootstrap modal within page1, an error is thrown: SyntaxError: Identifier 'createApp' has already been declared Content of page1.html: <script> const { createApp, ref } = Vue cr ...

What is the best way to showcase a file edited in Emacs within Atom?

The coding project I'm working on is built with Typescript, but I don't believe that's relevant. I've noticed that Emacs has a unique approach to indentation. According to the documentation, in Text mode and similar major modes, the TAB ...

Using V-for to iterate over a multi-dimensional array

As I venture into the world of vue.js, I find myself faced with the challenge of populating nested select elements using v-for. Despite scouring through various resources on this topic, I have been unable to determine a solution that fits my particular sce ...

Transferring String data between Java and JavaScript using Webview in both directions

I'm currently developing an application that allows two users to communicate via a webview. My goal is to transfer a String variable from JavaScript to Java in order to store it in my SQLite database, and also be able to do the reverse operation as we ...

In Javascript, ensuring a stopping condition for a recursive function that is looping through JSON data

I am having trouble figuring out how to set the break condition for this recursive function. Currently, the function is causing the browser to freeze (seems to be stuck in an endless loop). My goal is to create a series of nested unordered lists based on ...

Troubleshooting d3js Type Errors in Angular (Updated Version)

Encountering numerous type errors with d3js when integrating it into Angular (typescript). svg.call(d3.zoom().on('zoom', () => { g.attr('transform', d3.events.transform); })); Error thrown: S2345: Argument of type 'Zo ...

User retrieval failed following successful passport authentication

After a successful authentication, the user is directed to the "/profile" route, as demonstrated in the code snippet below. app.get( "/auth/google/callback", passport.authenticate("google", { successRedirect: "/profile", failureRedirect: " ...

Use JavaScript to sift through an array and exclusively retrieve items that match a specific value

I am working with an array of objects that contain a phase key, and I want to filter out only the ones that have a specific phase value. Additionally, I need to map some other key/value pairs into the final return. Here is my current code: phaseToBlocks ( ...

Switch out feature within prototype attribute looping

I'm attempting to substitute all hyphens in attributes with underscores. <a href="/page" id="someId" data-country="north-america" data-state="north-dakota">North Dakota</a> This is the code snippet I am using: var el = document.getEleme ...

The error message "React Native Redux useSelector is returning Undefined after navigation" has

After navigating to a new state, I am facing issues with accessing the updated state. Initially, I initialize my dataState in the reducer and update it using actions. On Screen 1, I successfully use this state after dispatching, but when moving to another ...

Determine using Lodash whether there is an object in an array that matches the ID from a separate array

There is a user array defined as follows: var users = [{ id: 1, name: 'ABC', isDisplay: true }, { id: 2, name: 'XYZ', isDisplay: true }, { id: 3, name: 'JKL', isDisplay: true }]; Additionally, there is another arra ...

The Intersection Observer encountered an issue as it was unable to access the property 'current' since it was undefined

My current project involves the implementation of IntersectionObserver, but I am facing an issue where I receive the error message Cannot read property 'current' of undefined. Can anyone help me identify what might be causing this problem? useOn ...

A step-by-step guide on generating a dynamic JSON file with JavaScript

I am in need of generating a JSON structure that follows this specific format: {"content": { "properties": { "area_id": "20", "origin": "3", "axis": "1", "x_start": "00", "x_end": "99", "y_start": "00", ...

JQuery Anchor Link Scrolling Problem on Specific Devices

I'm having an issue where my webpage does not scroll correctly to an anchor when a link is clicked. The problem arises from the header size changing based on the viewport width. While it works fine in desktop Chrome, in the mobile version the header h ...