-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Angular 13 - Must call super constructor in derived class before accessing 'this' #103
Comments
same problem |
Has anyone found a workaround to this? Our team has a blocker due to this in our component library. |
Same here, tried using with Phoenix framework and did not work. // JS Hook easepicker
import { easepick } from '@easepick/core';
import { RangePlugin } from '@easepick/range-plugin';
import { PresetPlugin } from '@easepick/preset-plugin';
export const hooks = {
mounted() {
const picker = new easepick.create({
element: this.el,
setup: (picker) => {
picker.on("select", (e) => {
const event = new Event("input", {
bubbles: true,
cancelable: true,
});
this.el.dispatchEvent(event);
});
},
css: [
"https://cdn.jsdelivr.net/npm/@easepick/core@1.2.1/dist/index.css",
"https://cdn.jsdelivr.net/npm/@easepick/range-plugin@1.2.1/dist/index.css",
"https://cdn.jsdelivr.net/npm/@easepick/preset-plugin@1.2.1/dist/index.css",
],
plugins: [
// RangePlugin, PresetPlugin
],
// PresetPlugin: {
// position: "left",
// },
});
debugger
console.log('this.picker', picker)
},
}; After changing to this: // JS Hook easepicker
// import { easepick } from '@easepick/bundle';
export const hooks = {
mounted() {
const picker = new easepick.create({
element: this.el,
setup: (picker) => {
picker.on("select", (e) => {
const event = new Event("input", {
bubbles: true,
cancelable: true,
});
this.el.dispatchEvent(event);
});
},
css: [
"https://cdn.jsdelivr.net/npm/@easepick/core@1.2.1/dist/index.css",
"https://cdn.jsdelivr.net/npm/@easepick/range-plugin@1.2.1/dist/index.css",
"https://cdn.jsdelivr.net/npm/@easepick/preset-plugin@1.2.1/dist/index.css",
],
plugins: [
// RangePlugin, PresetPlugin
],
// PresetPlugin: {
// position: "left",
// },
});
debugger
console.log('this.picker', picker)
},
}; and adding UMD version: <script src="https://cdn.jsdelivr.net/npm/@easepick/datetime@1.2.1/dist/index.umd.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@easepick/core@1.2.1/dist/index.umd.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@easepick/base-plugin@1.2.1/dist/index.umd.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@easepick/range-plugin@1.2.1/dist/index.umd.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@easepick/preset-plugin@1.2.1/dist/index.umd.min.js"></script> It works. |
I had this same error in a React application. I tracked it down to our bundler, since the easepick code looked fine and didn't reference When the error was ocurring, the generated code had an inserted I recommend checking your build/bundle tools. |
I'm doing some issue gardening 🌱🌿 🌷 and came upon this issue. Since it's quite old I just wanted to ask if this is still relevant? If it isn't, maybe we can close this issue? By closing some old issues we reduce the list of open issues to a more manageable set. |
@sandstrom I am experiencing the same error, and only when I build the project, it doesn't come up during the development Here's the part that my browser is complaining about after I built the project.
I use Angular 13
UpdateIf I add I think you would just need to replace the lines here
|
Describe the bug
I have an issue in Angular 13 with optimization: true. If I set optimization: false, it's working. but... I don't know what happen because I'm calling library as it says in the documentation with budle
Error:
In this part of the constructor
My angular.json
The text was updated successfully, but these errors were encountered: