question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Uncaught TypeError: Cannot set property 'dat' of undefined

See original GitHub issue

Uncaught TypeError: Cannot set property ‘dat’ of undefined at VM250 dat.gui.min.js:13 at VM250 dat.gui.min.js:13

I am assuming the problem lies in this part of the code where e.dat = {}

!function(e, t) {
    "object" == typeof exports && "undefined" != typeof module ? t(exports) : "function" == typeof define && define.amd ? define(["exports"], t) : t(e.dat = {})
}

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
knightcubecommented, Apr 20, 2021

This is my HTML file👇

<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>DAT Experiment</title>
    <link rel="stylesheet" href="./style.css">
</head>
<body>
    <canvas class="webgl"></canvas>
    <script type="module" src="index.js"></script>
</body>
</html>

And then in the index.js file, I had done something like this👇

import * as dat from './dat.gui-master/dat.gui-master/build/dat.gui.min.js'

I tried using dat.gui.module.js instead and it works now.

import * as dat from './dat.gui-master/dat.gui-master/build/dat.gui.module.js'

Thank you.

0reactions
knightcubecommented, Apr 19, 2021

I see. Thanks for the prompt response. Apologies coz It’s kinda late over here otherwise, I could share my approach with you right away. I will reply in the morning.

Read more comments on GitHub >

github_iconTop Results From Across the Web

JavaScript - cannot set property of undefined - Stack Overflow
Uncaught TypeError : Cannot set property 'greeting' of undefined. I'm trying to do something similar to an associative array. Why isn't this working?...
Read more >
Uncaught TypeError: Cannot set property
In JavaScript if a variable has been declared, but has not been assigned a value, is automatically assigned the value undefined . Therefore,...
Read more >
TypeError: Cannot set properties of Undefined in JavaScript
The "Cannot set properties of undefined" error occurs when setting a property on an undefined value. To solve the error, conditionally check if...
Read more >
How to solve the 'cannot set property of undefined' issue on ...
if a variable has been declared, but has not been assigned a value, is automatically assigned the value undefined . Therefore, if you...
Read more >
Cannot Read Property of Undefined in JavaScript - Rollbar
TypeError: Cannot read property of undefined occurs when a property is read or a function is called on an undefined variable.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found