Class does not work
See original GitHub issueThis is the code i am using
class Task {
constructor() {}
}
console.log("Loaded class_test.js");
module.exports = { Task };
I am compiling the code with bytenode using this command
"bytenode -c ./test_area/class_test.js
And when running this loader file:
const { Task } = require("./class_test.loader");
const t = new Task();
I get this error:
const t = new Task();
^
TypeError: Task is not a constructor
at Object.<anonymous> (C:\Users\gade1\WebstormProjects\nike-gen\test_area\bytenode_task_test.js:3:11)
at Module._compile (internal/modules/cjs/loader.js:1123:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1143:10)
at Module.load (internal/modules/cjs/loader.js:972:32)
at Function.Module._load (internal/modules/cjs/loader.js:872:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
at internal/main/run_main_module.js:17:47
But when running the non compiled version:
const { Task } = require("./class_test");
const t = new Task();
It works just fine. I have already read the known limitations, and i can not find any others having the same problem.
Node: v13.13.0 Bytenode: 1.2.1
Issue Analytics
- State:
- Created 2 years ago
- Comments:5
Top Results From Across the Web
HTML Class not working? - css - Stack Overflow
I'm trying to change the text color in a <p> to gray. I thought doing something like <p class="gray">content</p> and p. gray {...
Read more >not() - CSS: Cascading Style Sheets - MDN Web Docs
The :not() CSS pseudo-class represents elements that do not match a list of selectors. Since it prevents specific items from being selected, ...
Read more >addClass and removeClass in jQuery - not removing class
I'm trying to do something very simple. Basically I have a clickable div 'hot spot', when you click that it fills the screen...
Read more >.removeClass() | jQuery API Documentation
removeClass() method manipulated the className property of the selected elements, not the class attribute. Once the property was changed, it was the browser ......
Read more >custom class does not work - Mendix Forum
I am using Mendix 8.2.2 version and created “Mendix\UICHECK\theme\styles\web\sass\app\customwidgets\temp.scss” and register file to ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hello,
I am sorry for the inconvenience… you 're right, it was my fault… Thank you for this awesome module!
I guess you need to require the
.jsc
file directly, not the*.loader.js
file. The loader file is meant to be as your entry script or so.