@Hunta
I just create a blank new project with media native plugin.
when I run «npm install @angular/cli@8.3.12», I got your same error message when build a production file.
when I run «npm install @angular/cli@5.2.11», build error gone but mp3 fail to play.
here is my package.json:
{
«name»: «myApp»,
«version»: «0.0.1»,
«author»: «Ionic Framework»,
«homepage»: «http://ionicframework.com/»,
«private»: true,
«scripts»: {
«start»: «ionic-app-scripts serve»,
«clean»: «ionic-app-scripts clean»,
«build»: «ionic-app-scripts build»,
«lint»: «ionic-app-scripts lint»
},
«dependencies»: {
«@angular/animations»: «5.2.11»,
«@angular/cli»: «^8.3.12»,
«@angular/common»: «5.2.11»,
«@angular/compiler»: «5.2.11»,
«@angular/compiler-cli»: «^8.2.11»,
«@angular/core»: «5.2.11»,
«@angular/forms»: «5.2.11»,
«@angular/http»: «5.2.11»,
«@angular/platform-browser»: «5.2.11»,
«@angular/platform-browser-dynamic»: «5.2.11»,
«@ionic-native/core»: «~4.20.0»,
«@ionic-native/media»: «^4.20.0»,
«@ionic-native/splash-screen»: «~4.20.0»,
«@ionic-native/status-bar»: «~4.20.0»,
«@ionic/storage»: «2.2.0»,
«cordova-android»: «^8.1.0»,
«cordova-plugin-device»: «^2.0.2»,
«cordova-plugin-file»: «^6.0.2»,
«cordova-plugin-ionic-keyboard»: «^2.2.0»,
«cordova-plugin-ionic-webview»: «^4.1.2»,
«cordova-plugin-media»: «^5.0.3»,
«cordova-plugin-splashscreen»: «^5.0.2»,
«cordova-plugin-statusbar»: «^2.4.2»,
«cordova-plugin-whitelist»: «^1.3.3»,
«cordova-res»: «^0.8.0»,
«ionic-angular»: «3.9.5»,
«ionicons»: «3.0.0»,
«rxjs»: «5.5.11»,
«sharp»: «^0.23.1»,
«sw-toolbox»: «3.6.0»,
«zone.js»: «0.8.29»
},
«devDependencies»: {
«@ionic/app-scripts»: «3.2.2»,
«typescript»: «~2.6.2»
},
«description»: «An Ionic project»,
«cordova»: {
«plugins»: {
«cordova-plugin-media»: {},
«cordova-plugin-whitelist»: {},
«cordova-plugin-statusbar»: {},
«cordova-plugin-device»: {},
«cordova-plugin-splashscreen»: {},
«cordova-plugin-ionic-webview»: {
«ANDROID_SUPPORT_ANNOTATIONS_VERSION»: «27.+»
},
«cordova-plugin-ionic-keyboard»: {}
},
«platforms»: [
«android»
]
}
}
Answer by Lucian Melton
3) Open the packages.json of your main project and change the following versions of dependencies:,
Is centripetal acceleration almost perpendicular to velocity or it is exactly perpendicular to velocity?
,Once removed the circular dependency, everything worked fine.,I had the same problem with my [email protected] project after updating the CLI globally to version 8 and solve it by upgrading angular in my project to the latest version by running this command in my project directory:
I had the same problem with my [email protected]
project after updating the CLI globally to version 8 and solve it by upgrading angular in my project to the latest version by running this command in my project directory:
ng update @angular/cli @angular/core
You can also use the allow-dirty
flag to bypass the repo check:
ng update @angular/cli @angular/core --allow-dirty
Answer by Mckenna Casey
Hi:
I am getting error:
An unhandled exception occurred: Object prototype may only be an Object or null: undefined
when trying to build project in CI.
I found out the following dependencies while testing to build project:,https://stackoverflow.com/questions/57421582/typeerror-object-prototype-may-only-be-an-object-or-null-undefined-angular-8,Search or submit bugs against the npm CLI or any of our other maintained OSS projects,We have empty node_modules and no package-lock.json file.
So I do npm install (it will create package-lock) then ng build —prod
Hi:
I am getting error:
An unhandled exception occurred: Object prototype may only be an Object or null: undefined
when trying to build project in CI.
I found out the following dependencies while testing to build project:
An unhandled exception occurred: Object prototype may only be an Object or null: undefined
Answer by Zola Reed
Getting the error «Object prototype may only be an Object or null: undefined» when running «ionic serve»,Steps to reproduce:
Started getting this cryptic error message out of nowhere when I upgraded the Ionic CLI, ionic-app-scripts, and ionic-angular to the latest versions.,In my case there was a circular reference problem too. However, it was the export order on an index.ts file that was causing the problem.,Open the packages.json of your main project and change the following versions of dependencies:
«@angular/*»
«@ionic-native/*»
«rxjs»
Also, replace the «scripts» part.
Runtime Error
Object prototype may only be an Object or null: undefined
Stack
TypeError: Object prototype may only be an Object or null: undefined
at setPrototypeOf (<anonymous>)
at webpackJsonp.57.__extends (http://localhost:8100/build/main.js:5954:9)
at http://localhost:8100/build/main.js:5976:5
at Object.57 (http://localhost:8100/build/main.js:5988:2)
at __webpack_require__ (http://localhost:8100/build/vendor.js:55:30)
at Object.132 (http://localhost:8100/build/main.js:977:90)
at __webpack_require__ (http://localhost:8100/build/vendor.js:55:30)
at Object.249 (http://localhost:8100/build/main.js:3218:71)
at __webpack_require__ (http://localhost:8100/build/vendor.js:55:30)
at Object.130 (http://localhost:8100/build/main.js:724:105)
Answer by Alan Peters
I created new reactJs project to apply BPMN.IO,I have this package.json file
I have this package.json file
"dependencies": {
"bpmn-font": "^0.10.0",
"bpmn-js": "^7.4.0",
"bpmn-js-in-color": "github:bpmn-io/bpmn-js-in-color",
"diagram-js-minimap": "^2.0.3",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-scripts": "4.0.0",
"tiny-svg": "^2.2.2",
"web-vitals": "^0.2.4"
}
In my App.js
import React, { Fragment, Component } from "react";
import BpmnModeler from "bpmn-js/lib/Modeler";
import { emptyBpmn } from "./diagram.bpmn.jsx";
import bpmnJsInColor from "bpmn-js-in-color";
import minimapModule from "diagram-js-minimap";
import "./vendor/diagram-js.css";
import "bpmn-font/dist/css/bpmn-embedded.css";
import "diagram-js-minimap/assets/diagram-js-minimap.css";
class App extends Component {
modeler = null;
saveModelHandler = (event) => {
event.preventDefault();
};
componentDidMount = () => {
this.modeler = new BpmnModeler({
container: "#bpmnview",
additionalModules: [require("bpmn-js-in-color")],
keyboard: { bindTo: document },
});
this.newBpmnDiagram();
};
newBpmnDiagram = () => {
this.openBpmnDiagram(emptyBpmn);
};
openBpmnDiagram = async (xml) => {
await this.modeler.importXML(xml);
var canvas = this.modeler.get("canvas");
canvas.zoom("fit-viewport");
};
render = () => {
return (
<Fragment>
<div
id="bpmnview"
style={{ width: "100%", height: "100vh", float: "left" }}
></div>
</Fragment>
);
};
}
export default App;
When I enter npm start
. It throws error
**TypeError: Object prototype may only be an Object or null: undefined**
inherits
**node_modules/inherits/inherits_browser.js:6**
3 | module.exports = function inherits(ctor, superCtor) {
4 | if (superCtor) {
5 | ctor.super_ = superCtor
> 6 | ctor.prototype = Object.create(superCtor.prototype, {
| ^ 7 | constructor: {
8 | value: ctor,
9 | enumerable: false,
Answer by Emerson Parrish
Hi guys ,
maybe you can help me to investigate this issue …
when I’m running my build like :,ionic cordova run android —release -> have no issues and all good,ionic cordova run android —release -> have no issues and all good,ionic cordova run android —release – prod I got this error and I try to find out what is that :
cli packages: (/usr/local/lib/node_modules)
@ionic/cli-utils : 1.19.1
ionic (Ionic CLI) : 3.19.1
global packages:
cordova (Cordova CLI) : 8.0.0
local packages:
@ionic/app-scripts : 3.2.4
Cordova Platforms : android 6.4.0 ios 4.5.5
Ionic Framework : ionic-angular 3.9.2
System:
ios-deploy : 1.9.2
ios-sim : 5.0.4
Node : v10.16.3
npm : 6.9.0
OS : macOS
Xcode : Xcode 10.3 Build version 10G8
Environment Variables:
ANDROID_HOME : not set
Misc:
backend : pro
Answer by Berkley Quinn
TypeError: Object prototype may only be an Object or null: undefined
,[ ] question
[x] bug report
[ ] feature request
[ ] documentation issue,[ ] latest
[ ] @next
[x] 3.0.2
I am switching from TDL to Airgram and get this error:
1|hr | /home/hr/node_modules/airgram/components/TdProvider.js:7
1|hr | return extendStatics(d, b);
1|hr | ^
1|hr | TypeError: Object prototype may only be an Object or null: undefined
1|hr | at setPrototypeOf (<anonymous>)
1|hr | at extendStatics (/home/hr/node_modules/airgram/components/TdProvider.js:7:16)
1|hr | at __extends (/home/hr/node_modules/airgram/components/TdProvider.js:10:9)
1|hr | at /home/hr/node_modules/airgram/components/TdProvider.js:66:5
1|hr | at Object.<anonymous> (/home/hr/node_modules/airgram/components/TdProvider.js:128:2)
1|hr | at Module._compile (internal/modules/cjs/loader.js:689:30)
1|hr | at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
1|hr | at Module.load (internal/modules/cjs/loader.js:599:32)
1|hr | at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
1|hr | at Function.Module._load (internal/modules/cjs/loader.js:530:3)
Answer by Hugh McPherson
As you saw, changing Customer.ts to import from ./Entity directly instead of ./index breaks the cycle, and everything works as expected. Another solution would be to reverse the order of imports in index.ts.
As I suspected, your original program has circular imports. Run.ts
imports index.ts
, which imports Customer.ts
, which imports index.ts
again. Since index.ts
is already in the process of loading and itself depends on Customer.ts
, the import { Entity } from "./index";
just binds the Entity
of index.ts
(which is not set yet) to the Entity
of Customer.ts
, and execution proceeds even though index.ts
isn’t finished loading. Then Entity
is undefined at the time you try to extend it. You might argue that a circular import should be an error or that JavaScript engines should use some other algorithm that correctly handles your scenario; I’m not qualified to comment on why the current design was chosen. (Others feel free to add information about this.)
Run.ts
As I suspected, your original program has circular imports. Run.ts
imports index.ts
, which imports Customer.ts
, which imports index.ts
again. Since index.ts
is already in the process of loading and itself depends on Customer.ts
, the import { Entity } from "./index";
just binds the Entity
of index.ts
(which is not set yet) to the Entity
of Customer.ts
, and execution proceeds even though index.ts
isn’t finished loading. Then Entity
is undefined at the time you try to extend it. You might argue that a circular import should be an error or that JavaScript engines should use some other algorithm that correctly handles your scenario; I’m not qualified to comment on why the current design was chosen. (Others feel free to add information about this.)
index.ts
As I suspected, your original program has circular imports. Run.ts
imports index.ts
, which imports Customer.ts
, which imports index.ts
again. Since index.ts
is already in the process of loading and itself depends on Customer.ts
, the import { Entity } from "./index";
just binds the Entity
of index.ts
(which is not set yet) to the Entity
of Customer.ts
, and execution proceeds even though index.ts
isn’t finished loading. Then Entity
is undefined at the time you try to extend it. You might argue that a circular import should be an error or that JavaScript engines should use some other algorithm that correctly handles your scenario; I’m not qualified to comment on why the current design was chosen. (Others feel free to add information about this.)
Customer.ts
As I suspected, your original program has circular imports. Run.ts
imports index.ts
, which imports Customer.ts
, which imports index.ts
again. Since index.ts
is already in the process of loading and itself depends on Customer.ts
, the import { Entity } from "./index";
just binds the Entity
of index.ts
(which is not set yet) to the Entity
of Customer.ts
, and execution proceeds even though index.ts
isn’t finished loading. Then Entity
is undefined at the time you try to extend it. You might argue that a circular import should be an error or that JavaScript engines should use some other algorithm that correctly handles your scenario; I’m not qualified to comment on why the current design was chosen. (Others feel free to add information about this.)
index.ts
As I suspected, your original program has circular imports. Run.ts
imports index.ts
, which imports Customer.ts
, which imports index.ts
again. Since index.ts
is already in the process of loading and itself depends on Customer.ts
, the import { Entity } from "./index";
just binds the Entity
of index.ts
(which is not set yet) to the Entity
of Customer.ts
, and execution proceeds even though index.ts
isn’t finished loading. Then Entity
is undefined at the time you try to extend it. You might argue that a circular import should be an error or that JavaScript engines should use some other algorithm that correctly handles your scenario; I’m not qualified to comment on why the current design was chosen. (Others feel free to add information about this.)
index.ts
As I suspected, your original program has circular imports. Run.ts
imports index.ts
, which imports Customer.ts
, which imports index.ts
again. Since index.ts
is already in the process of loading and itself depends on Customer.ts
, the import { Entity } from "./index";
just binds the Entity
of index.ts
(which is not set yet) to the Entity
of Customer.ts
, and execution proceeds even though index.ts
isn’t finished loading. Then Entity
is undefined at the time you try to extend it. You might argue that a circular import should be an error or that JavaScript engines should use some other algorithm that correctly handles your scenario; I’m not qualified to comment on why the current design was chosen. (Others feel free to add information about this.)
Customer.ts
As I suspected, your original program has circular imports. Run.ts
imports index.ts
, which imports Customer.ts
, which imports index.ts
again. Since index.ts
is already in the process of loading and itself depends on Customer.ts
, the import { Entity } from "./index";
just binds the Entity
of index.ts
(which is not set yet) to the Entity
of Customer.ts
, and execution proceeds even though index.ts
isn’t finished loading. Then Entity
is undefined at the time you try to extend it. You might argue that a circular import should be an error or that JavaScript engines should use some other algorithm that correctly handles your scenario; I’m not qualified to comment on why the current design was chosen. (Others feel free to add information about this.)
import { Entity } from "./index";
As I suspected, your original program has circular imports. Run.ts
imports index.ts
, which imports Customer.ts
, which imports index.ts
again. Since index.ts
is already in the process of loading and itself depends on Customer.ts
, the import { Entity } from "./index";
just binds the Entity
of index.ts
(which is not set yet) to the Entity
of Customer.ts
, and execution proceeds even though index.ts
isn’t finished loading. Then Entity
is undefined at the time you try to extend it. You might argue that a circular import should be an error or that JavaScript engines should use some other algorithm that correctly handles your scenario; I’m not qualified to comment on why the current design was chosen. (Others feel free to add information about this.)
Entity
As I suspected, your original program has circular imports. Run.ts
imports index.ts
, which imports Customer.ts
, which imports index.ts
again. Since index.ts
is already in the process of loading and itself depends on Customer.ts
, the import { Entity } from "./index";
just binds the Entity
of index.ts
(which is not set yet) to the Entity
of Customer.ts
, and execution proceeds even though index.ts
isn’t finished loading. Then Entity
is undefined at the time you try to extend it. You might argue that a circular import should be an error or that JavaScript engines should use some other algorithm that correctly handles your scenario; I’m not qualified to comment on why the current design was chosen. (Others feel free to add information about this.)
index.ts
As I suspected, your original program has circular imports. Run.ts
imports index.ts
, which imports Customer.ts
, which imports index.ts
again. Since index.ts
is already in the process of loading and itself depends on Customer.ts
, the import { Entity } from "./index";
just binds the Entity
of index.ts
(which is not set yet) to the Entity
of Customer.ts
, and execution proceeds even though index.ts
isn’t finished loading. Then Entity
is undefined at the time you try to extend it. You might argue that a circular import should be an error or that JavaScript engines should use some other algorithm that correctly handles your scenario; I’m not qualified to comment on why the current design was chosen. (Others feel free to add information about this.)
Entity
As I suspected, your original program has circular imports. Run.ts
imports index.ts
, which imports Customer.ts
, which imports index.ts
again. Since index.ts
is already in the process of loading and itself depends on Customer.ts
, the import { Entity } from "./index";
just binds the Entity
of index.ts
(which is not set yet) to the Entity
of Customer.ts
, and execution proceeds even though index.ts
isn’t finished loading. Then Entity
is undefined at the time you try to extend it. You might argue that a circular import should be an error or that JavaScript engines should use some other algorithm that correctly handles your scenario; I’m not qualified to comment on why the current design was chosen. (Others feel free to add information about this.)
Customer.ts
As I suspected, your original program has circular imports. Run.ts
imports index.ts
, which imports Customer.ts
, which imports index.ts
again. Since index.ts
is already in the process of loading and itself depends on Customer.ts
, the import { Entity } from "./index";
just binds the Entity
of index.ts
(which is not set yet) to the Entity
of Customer.ts
, and execution proceeds even though index.ts
isn’t finished loading. Then Entity
is undefined at the time you try to extend it. You might argue that a circular import should be an error or that JavaScript engines should use some other algorithm that correctly handles your scenario; I’m not qualified to comment on why the current design was chosen. (Others feel free to add information about this.)
index.ts
As I suspected, your original program has circular imports. Run.ts
imports index.ts
, which imports Customer.ts
, which imports index.ts
again. Since index.ts
is already in the process of loading and itself depends on Customer.ts
, the import { Entity } from "./index";
just binds the Entity
of index.ts
(which is not set yet) to the Entity
of Customer.ts
, and execution proceeds even though index.ts
isn’t finished loading. Then Entity
is undefined at the time you try to extend it. You might argue that a circular import should be an error or that JavaScript engines should use some other algorithm that correctly handles your scenario; I’m not qualified to comment on why the current design was chosen. (Others feel free to add information about this.)
Entity
#javascript #node.js #es6-modules #vite #filestack
Вопрос:
Я использую filestack-js
в проекте Rails, который поставляется в комплекте с Vite. Все работает так, как ожидалось, пока я не включу модуль ESM для filestack-js
библиотеки, в данном случае в контроллер StimulusJS:
import { Controller } from "stimulus";
import * as filestack from "filestack-js";
export default class extends Controller {
// some irrelevant implementation code that calls filestack.init(...)
}
Загрузка вышеуказанного файла контроллера в браузере вызывает ошибку:
tslib.es6.js:25 Uncaught TypeError: Object prototype may only be an Object or null: undefined
at setPrototypeOf (<anonymous>)
at __extends (tslib.es6.js:25)
at http.ts:43
at node_modules/filestack-js/build/module/lib/request/adapters/http.js (http.ts:64)
at __init (chunk-IHTDASF6.js?v=1616a449:14)
at request_adapter.node.ts:17
Это ошибка, вызванная браузером при работе в среде разработки, при использовании Vite для создания и обслуживания модулей ES непосредственно в браузере. Он обрабатывает компиляцию машинописного текста. Удаление import * as filestack
бита устраняет ошибку (но, очевидно, нарушает функциональность класса).
Мои поиски в Google, похоже, предполагают, что это может быть проблемой циклической зависимости. Трассировка стека браузера указывает на файл в filestack-js
библиотеке:
// src/lib/request/adapters/http.ts
import * as url from 'url';
import * as zlib from 'zlib';
import Debug from 'debug';
import { AdapterInterface } from './interface';
import { getVersion } from '../../utils';
import * as Stream from 'stream'; // <---------- Stream imported here
import { FsRequestOptions, FsResponse } from '../types';
import * as utils from '../utils';
import { prepareData, parseResponse, combineURL, set as setHeader, normalizeHeaders } from './../helpers';
import { FsRequestErrorCode, FsRequestError } from '../error';
import { FsHttpMethod } from './../types';
const HTTPS_REGEXP = /https:?/;
const HTTP_CHUNK_SIZE = 16 * 1024;
const MAX_REDIRECTS = 10;
const CANCEL_CLEAR = `FsCleanMemory`;
const debug = Debug('fs:request:http');
class HttpWritableStream extends Stream.Writable {
// omitted class definition
}
Где Stream.Writable
на самом деле не определено из-за проблемы циклической зависимости. Я понятия не имею, как это могло произойти или, похоже, повлияло только на меня.
Это не проблема, о которой сообщалось в отслеживателе проблем filestack-js.
Отладка в браузере и локальное клонирование/связывание репозитория подтвердили , что Stream.Writable
это возвращается undefined
, но я недостаточно знаю о JS, чтобы понять, почему. Предположительно, это обычно происходит из-за циклической зависимости, но я не уверен, как модуль nodejs Stream
будет иметь циклические зависимости от случайной библиотеки, например filestack-js
. Я также достаточно неопытен в мире JS, чтобы точно понять, что значит использовать библиотеку NodeJS, как Stream
в модуле браузера, — filestack-js
в ней есть как браузерные модули, так и модули CommonJS/NodeJS, поэтому я не уверен, как/связаны ли они или взаимодействуют.
Вот как Stream
выглядит объект при входе в консоль браузера. Очевидно, что что-то было импортировано, но Writable
не является свойством того, что было импортировано:
FWIW это происходит в Chrome и Firefox, последних версиях каждого из них.
Я также попытался использовать dpdm
для анализа проекта filestack-js на наличие циклических зависимостей. Он нашел некоторые, но не похоже, что они вызывают ошибки, и, похоже, явно исключаются библиотеки узлов и другие библиотеки зависимостей.
Комментарии:
1. Хорошо, я вижу, что это может быть связано с тем фактом, что Vite использует накопительный пакет под капотом, и этот накопительный пакет может не справляться с определенными циклическими зависимостями, существующими в библиотеках NodeJS? это репозиторий существует, и кажется, что он может быть разработан для решения такого рода проблем, но, похоже, он не работает для меня.
2. Действительно ли этот стимул и ваш собственный класс необходимы для того, чтобы вызвать проблему, или это уже происходит, если все, что вы делаете, — это импортируете
filestack-js
библиотеку?3. @Bergi Я могу подтвердить, что это не имеет отношения к делу. Просто так получилось, что я пользуюсь библиотекой именно там. Извини, что я не ясно выразился.
4. В этом случае я бы определенно сообщил об этом как об ошибке в их системе отслеживания проблем. Тем более, что документация утверждает, что работает с накопительным пакетом из коробки. Однако вам следует поделиться своей конфигурацией свертки
5. Ого, я пропустил эту ссылку на свертку. До сих пор я не решался опубликовать проблему, потому что у меня нет простого решения, но, думаю, я мог бы придумать более простое. Спасибо.
Ответ №1:
Хорошо, я думаю, что решил свою проблему, но я не эксперт, поэтому я попытаюсь объяснить, в чем была проблема. Не стесняйтесь вступать в разговор с разъяснениями, если вам лучше известно.
Это было вызвано filestack-js
интенсивным использованием библиотек nodejs. Исторически сложилось так, что Webpack v4 заполнил множество распространенных библиотек NodeJS для использования в браузере, полностью прозрачных для большинства разработчиков. Это прекрасно работало, но было полным волшебством.
Накопительный пакет и, кстати, Webpack v5 не выполняют этого заполнения, поэтому любые библиотеки NodeJS, используемые библиотеками «ESM» из NPM, которые напрямую не совместимы с современными браузерами, просто сломаются. Чтобы заполнить это вручную, мне пришлось поручить Vite amp; Rollup присвоить псевдоним имени модуля nodejs stream
чему-то, что напрямую совместимо с браузерами, и установить его. Чтобы сделать это, я:
yarn add --dev stream-browserify
И добавил следующее к моему vite.config.js
:
// ...
resolve: {
alias: {
stream: "stream-browserify",
},
},
// ...
Должен быть очень похожий (но другой) способ сообщить свертке, чтобы сделать это, потому что здесь я делаю это через конфигурацию Vite.
Для дополнительного контекста вот проблема GitHub, которую я открыл в filestack-js
репо: https://github.com/filestack/filestack-js/issues/458
Ответ №2:
- Table of contents
- TypeError: Object prototype may only be an Object or null: undefined
- Object prototype may only be an Object or null: undefined
#648
Find the data you need here
We provide programming data of 20 most popular languages, hope to help you!
Previous PostNext Post
TypeError: Object prototype may only be an Object or null: undefined
export { Customer } from "./Customer";
export { Entity } from "./Entity";
import { Entity } from "./index";
export class Customer extends Entity {
sku: string;
constructor(po: any) {
super();
this.sku = po.sku;
}
}
export abstract class Entity {
id?: string;
}
import {Customer} from "./";
let c = new Customer({
name: "Bob"
});
console.log(c);
export abstract class Entity {
id?: string;
}
export class Customer extends Entity {
sku: string;
constructor(po: any) {
super();
this.sku = po.sku;
}
}
Customer { sku: undefined }
class Proxy {}
class MyProxy extends Proxy {}
Uncaught TypeError: Object prototype may only be an Object or null: undefined
at Function.setPrototypeOf (<anonymous>)
at polyfills.js:139
at patch (polyfills.js:141)
at patch (graceful-fs.js:104)
at Object.../../../../node_modules/graceful-fs/graceful-fs.js (graceful-fs.js:96)
at Object.options.factory (react refresh:6)
at __webpack_require__ (bootstrap:24)
at fn (hot module replacement:61)
at Object.../../../../node_modules/fs-extra/lib/fs/index.js (index.js:5)
at Object.options.factory (react refresh:6)
// This ensures `util.promisify` works as it does for native `fs.read`.
if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read)`
resolve: {
fallback: {
"path": require.resolve("path-browserify"),
"stream": require.resolve("stream-browserify"),
"constants": require.resolve("constants-browserify"),
"util": require.resolve("util"),
"process": require.resolve("process/browser"),
"fs": require.resolve("graceful-fs")
}
}
// This ensures `util.promisify` works as it does for native `fs.read`.
if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read)
Uncaught TypeError: Object prototype may only be an Object or null: undefined
at setPrototypeOf (<anonymous>)
at i (index.js:1)
at s (index.js:1)
at index.js:1
at Object.self.MonacoEnvironment.getWorkerUrl (index.js:1)
at o (index.js:1)
at Object.self.MonacoEnvironment.getWorkerUrl (index.js:1)
at o (index.js:1)
at Module.self.MonacoEnvironment.getWorkerUrl (index.js:1)
at o (index.js:1)
import React from "react";
import { App } from "./demo";
export default { title: "Button" };
const s = document.createElement("script");
s.type = "module";
s.src = "https://cdn.jsdelivr.net/npm/@vanillawc/wc-monaco-editor/index.js";
document.body.appendChild(s);
function Editor(props: { value: string }) {
const ref = React.useRef<HTMLDivElement>(null);
React.useEffect(() => {
if (!ref.current) return;
const dom = document.createElement("wc-wc-monaco-editor");
dom.setAttribute("id", Math.random().toString());
dom.setAttribute("language", "javascript");
ref.current.appendChild(dom);
return () => dom.remove();
}, [ref.current]);
React.useEffect(() => {
if (!ref.current) return;
// @ts-ignore
ref.current.firstChild!.value = props.value;
}, [ref.current, props.value]);
return <div ref={ref}></div>;
}
export const Demo = () => (
<>
<Editor value="return <div>AAAAAAAAA</div>;" />
<Editor value="return <div>Hello world!</div>;" />
</>
);
Uncaught TypeError: Object prototype may only be an Object or null: undefined
at setPrototypeOf (<anonymous>)
at __extends (eval at <anonymous> (bundle.js:13399), <anonymous>:8:9)
at eval (eval at <anonymous> (bundle.js:13399), <anonymous>:28:5)
at eval (eval at <anonymous> (bundle.js:13399), <anonymous>:301:2)
at Object.<anonymous> (bundle.js:13399)
at __webpack_require__ (bundle.js:556)
at fn (bundle.js:87)
at eval (eval at <anonymous> (bundle.js:13390), <anonymous>:14:19)
at Object.<anonymous> (bundle.js:13390)
at __webpack_require__ (bundle.js:556)
at fn (bundle.js:87)
at eval (eval at <anonymous> (bundle.js:13255), <anonymous>:10:24)
at Object.<anonymous> (bundle.js:13255)
at __webpack_require__ (bundle.js:556)
at fn (bundle.js:87)
at eval (eval at <anonymous> (bundle.js:13246), <anonymous>:1:1)
"ag-grid": "~7.1.0",
"ag-grid-enterprise": "^14.2.0",
"ag-grid-react": "~7.1.0",
"ag-grid-community": "^25.3.0",
"ag-grid-enterprise": "^25.3.0",
"ag-grid-react": "^25.3.0",
Object prototype may only be an Object or null: undefined
#648
if (!NATIVE_ARRAY_BUFFER_VIEWS || !TypedArrayPrototype || TypedArrayPrototype === ObjectPrototype) {
TypedArrayPrototype = TypedArray.prototype;
if (NATIVE_ARRAY_BUFFER_VIEWS)
for (NAME in TypedArrayConstructorsList) {
// | setPrototypeOf fails
if (global[NAME]) setPrototypeOf(global[NAME].prototype, TypedArrayPrototype);
}
}
module.exports = {
presets: [
[
'@babel/env',
{
modules: NODE_ENV === 'test' ? 'auto' : false,
useBuiltIns: 'entry',
corejs: 3,
},
],
'@babel/react',
'@babel/preset-flow',
],
comments: true,
plugins: [
'@babel/transform-runtime',
'@babel/plugin-transform-flow-strip-types',
'@babel/plugin-proposal-object-rest-spread',
'@babel/plugin-proposal-export-namespace-from',
'@babel/plugin-proposal-class-properties',
'@babel/plugin-proposal-function-bind',
'lodash',
'syntax-dynamic-import',
...(NODE_ENV === 'test' ? ['dynamic-import-node'] : []),
],
}
{
"browserslist": [
"chrome >= 50",
"firefox >= 52",
"safari >= 10",
"ie >= 11"
]
}
Uncaught TypeError: Object prototype may only be an Object or null: undefined
TypeError: undefined
File (native) line (unknown) in setPrototypeOf
File ../node_modules/core-js/internals/array-buffer-view-core.js line 151 col 23 in Object.<anonymous>
if (global[NAME]) setPrototypeOf(global[NAME].prototype, TypedArrayPrototype);
File https://example.com/ line 1 col 27653 in a
File ../node_modules/core-js/internals/array-buffer.js line 7 col 27 in Object.<anonymous>
var NATIVE_ARRAY_BUFFER = require('../internals/array-buffer-view-core').NATIVE_ARRAY_BUFFER;
File https://example.com/ line 1 col 27653 in a
File ../node_modules/core-js/modules/es.array-buffer.constructor.js line 7 col 25 in Object.<anonymous>
var arrayBufferModule = require('../internals/array-buffer');
File https://example.com/ line 1 col 27653 in a
File ../node_modules/react-app-polyfill/stable.js line 95 col 1 in Object.<anonymous>
require("core-js/modules/es.array-buffer.constructor");
File https://example.com/ line 1 col 27653 in a
File https://example.com/static/js/main.f643d182.chunk.js line 1 col 252 in Object.push.1134
// Polyfills create-react-app requires so that the site works in Internet Explorer 11.
import "react-app-polyfill/ie11";
// Polyfill stable JavaScript features
import "react-app-polyfill/stable";
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
Uncaught TypeError: Object prototype may only be an Object or null: undefined
File (native) line (unknown) in setPrototypeOf
File webpack:///./node_modules/core-js/internals/array-buffer-view-core.js line 128 col 23 in Object.<anonymous>
if (global[NAME]) setPrototypeOf(global[NAME].prototype, TypedArrayPrototype);
File webpack:///webpack/bootstrap line 89 col 22 in c
modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
File webpack:///./node_modules/core-js/internals/array-buffer.js line 4 col 27 in Object.<anonymous>
var NATIVE_ARRAY_BUFFER = require('../internals/array-buffer-view-core').NATIVE_ARRAY_BUFFER;
File webpack:///webpack/bootstrap line 89 col 22 in c
modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
File webpack:///./node_modules/core-js/modules/es.array-buffer.constructor.js line 4 col 25 in Object.<anonymous>
var arrayBufferModule = require('../internals/array-buffer');
File webpack:///webpack/bootstrap line 89 col 22 in c
modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
import 'core-js/stable'
import 'regenerator-runtime/runtime'
@babel/core: 7.6.4
@babel/preset-env: 7.6.3
@babel/runtime-corejs3: 7.6.3
core-js: 3.3.3
webpack: 4.41.2
<!doctype html>
<html>
<head>
<script src="js/libs/jquery-1.7.2.min.js"></script>
<script src="js/libs/ember-1.0.0-pre.2.min.js"></script>
<script src="js/libs/handlebars-1.0.0.beta.6.js"></script>
<script src="js/app.js"></script>
</head>
<script type="text/x-handlebars" data-template-name="application">
Test
</script>
</html>
App = Em.Application.create();
App.ApplicationView = Em.View.extend({
templateName: 'application'
});
App.ApplicationController = Em.Controller.extend();
App.Router = Em.Router.extend({
root: Em.Route.extend({
index: Em.Route.extend({
route: '/'
})
})
});
App.initialize();
Uncaught TypeError: Object prototype may only be an Object or null
Uncaught Error: <App.ApplicationView:ember143> - Unable to find template "application".
<!doctype html>
<html>
<head>
<script type="text/x-handlebars" data-template-name="application">
Test
</script>
<script src="js/libs/jquery-1.7.2.min.js"></script>
<script src="js/libs/handlebars-1.0.0.beta.6.js"></script>
<script src="js/libs/ember-1.0.0-pre.2.min.js"></script>
<script src="js/app.js"></script>
</head>
</html>
"scripts": {
"serve": "vue-cli-service serve",
"build": "tsc && vue-cli-service build",
"start": "NODE_ENV=production node dist/server.js",
"lint": "vue-cli-service lint"
},
<template>
<div id="canvascontainer">
<canvas id="renderCanvas"></canvas>
</div>
</template>
<script>
import * as dependency1 from "dependency1";
import "dependency2";
import { Component1, Component2 } from "3d_lib";
import { Extension } from "3d_lib_extension"; // <-- This one throws the error
export default {
data() {
return {
...
}
},
mounted: function() {
window.DEPENCENCY1 = dependency1; // Needs to be global
this.init();
},
methods: {
init: function() {
...
}
}
}
</script>
//css stuff, not relevant
chainWebpack: config => {
if (process.env.NODE_ENV === "production") {
config.optimization.minimize(false);
}
}
"browser": {
"zlib": false,
"tls": false,
"stream": false,
"path": false,
"os": false,
"net": false,
"https": false,
"fs": false,
"crypto": false,
"constants": false,
"child_process": false,
"http": false
}
Uncaught (in promise) TypeError: Object prototype may only be an Object or null: undefined
at Function.create (<anonymous>)
at Object.inherits (inherits_browser.js:5)
at Object.ocFe (data-stream.js:39)
at __webpack_require__ (bootstrap:79)
at Object.bDwd (sign-stream.js:3)
at __webpack_require__ (bootstrap:79)
at Object.M+8A (index.js:2)
at __webpack_require__ (bootstrap:79)
at Object.9EfD (index.js:12)
at __webpack_require__ (bootstrap:79)
Previous PostNext Post