Skip to content
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

TypeError: undefined is not a function (near '...definition.fromUrl(value).then...') #36

Open
aufdenpunkt opened this issue Sep 24, 2018 · 2 comments

Comments

@aufdenpunkt
Copy link

aufdenpunkt commented Sep 24, 2018

Did anyone get the following error before? I have no idea what the problem is …

screenshot 2018-09-24 at 22 18 16

In this case svg is a valid URL to an existing SVG.

screenshot 2018-09-24 at 22 18 42

CONSOLE LOG file:///app/tns_modules/@angular/core/bundles/core.umd.js:3194:24: Angular is running in the development mode. Call enableProdMode() to enable the production mode.
CONSOLE ERROR [native code]: ERROR TypeError: undefined is not a function (near '...definition.fromUrl(value).then...')
CONSOLE ERROR [native code]: ERROR CONTEXT {
"view": {
"def": {
"nodeFlags": 33734657,
"rootNodeFlags": 33554433,
"nodeMatchedQueries": 0,
"flags": 0,
"nodes": [
{
"nodeIndex": 0,
"parent": null,
"renderParent": null,
"bindingIndex": 0,
"outputIndex": 0,
"checkIndex": 0,
"flags": 33554433,
"childFlags": 180225,
"directChildFlags": 49153,
"childMatchedQueries": 0,
"matchedQueries": {},
"matchedQueryIds": 0,
"references": {},
"ngContentIndex": null,
"childCount": 3,
"bindings": [],
"bindingFlags": 0,
"outputs": [],
"element": {
"ns": "",
"name": "ActionBar",
"attrs": [
[
"",
"class",
"action-bar"
],
[
"",
"title",

I'm using the following versions: [email protected], [email protected] and [email protected]

Please let me know, when you need further details.

Thanks and best,
Chris

@aquinn637
Copy link

I have the same problem. NS 6 and Angular 8

@macroorganizm
Copy link

macroorganizm commented Apr 1, 2020

Same issue. For now, i use this workaround, seems working

<SVGImage [src]="src"></SVGImage>

const svgContent = await fetch(url);
const asText = await svgContent.text();
const buffer = new Buffer(asText);
const base64 = buffer.toString('base64');
const header = 'data:image/svg+xml;base64,';
this.src = header + base64;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants