I am trying to include an angular web component inside of an angular application. But I am getting this error.
SyntaxError: Unexpected token < in JSON at position 0
at JSON.parse (<anonymous>)
at XMLHttpRequest.o (https://ordexstorageaccounttst.blob.core.windows.net/offer-form/elements/offer-request-form.js:3:295463)
at e.invokeTask (https://ordexstorageaccounttst.blob.core.windows.net/offer-form/elements/offer-request-form.js:2:8043)
at Object.onInvokeTask (https://ordexstorageaccounttst.blob.core.windows.net/offer-form/elements/offer-request-form.js:3:186798)
at e.invokeTask (https://ordexstorageaccounttst.blob.core.windows.net/offer-form/elements/offer-request-form.js:2:7964)
at t.runTask (https://ordexstorageaccounttst.blob.core.windows.net/offer-form/elements/offer-request-form.js:2:3122)
at t.invokeTask [as invoke] (https://ordexstorageaccounttst.blob.core.windows.net/offer-form/elements/offer-request-form.js:2:9175)
at g (https://ordexstorageaccounttst.blob.core.windows.net/offer-form/elements/offer-request-form.js:2:21786)
at XMLHttpRequest.y (https://ordexstorageaccounttst.blob.core.windows.net/offer-form/elements/offer-request-form.js:2:22092)
When including the web component inside a normal static HTML file it works but when I try to do so in an angular application it won't work.
Also when including the web component like this
const offerFormElement = document.createElement('offer-request-form');
it also seems to be working. But I am trying to include it like this
<offer-request-form></offer-request-form>
Any help would be appreciated.
Edit: Could it be the webpack config? I read some things online saying I should rename the JSON function name in the webpack config but I am not getting it to work.