[rc0] Uncaught ReferenceError: require is not defined

Removed buffer and rollup-plugin-node-polyfills it didn’t fix the issue. I’ve search in all of my app and I’m not using any require() except the one I’m trying to make work, including in my dependencies.

If that helps, I’m converting my app from Angular to StencilJS.

Forgive me for being a tad exasperated, but if you knew from the beginning where the offending require was, why haven’t you gotten rid of it?

That’s not my question, I’m wondering why it doesn’t work in StencilJS. The same require() used to work when my project was under Angular and I’m wondering what’s the proper way to import a .js script now that I’m using StencilJS. I’m sorry if I formulated that wrong in my initial question, I’m just trying to make require() work.

Then I would suggest making a new topic in the Stencil forum category. You are clear that Stencil is for making Web Components, not entire apps, right? It’s not a replacement for Angular or React.

I shall make a new topic then. We’re transferring from Angular to Ionic, is what I meant. My boss was positive that it was a StencilJS problem, hence why I was posting here, and not on the Ionic Forums. Thanks a lot for your help. Sorry if I seem confused about all of this, it’s because I am.

If it’s any consolation, you can’t be a tenth as confused as I am, because…

Here is the Ionic Forums.

I would consider that what the philosophers call a “category error”. Angular is a framework for making web applications. Ionic historically used to be a framework for making mobile web applications that sat on top of AngularJS. Now I would say it’s more akin to Bootstrap or Material Design Components - providing Web Components that are optimized for mobile yet usable in browsers anywhere. If you’re trying to make another one of those Web Components - a self-contained widget that does a single thing and can be incorporated into web apps - then Stencil is indeed what you want to be using.

So today, you can make web applications using Angular or React that incorporate Ionic components. You can extend Ionic’s component library using Stencil. What you don’t want to be doing, which I fear you sound like you are trying to do, is write a web application using Stencil. If you’re writing a web app, as opposed to a single component, you don’t need to and don’t want to be interacting with Stencil at all. You want to keep writing Angular.