question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

how to make it work in ionic4

See original GitHub issue

Hi,

I try to make it work in ionic 4

import { Component, OnInit } from '@angular/core';
import WooCommerceRestApi from "@woocommerce/woocommerce-rest-api";

@Component({
  selector: 'app-productlist',
  templateUrl: './productlist.page.html',
  styleUrls: ['./productlist.page.scss'],
})
export class ProductlistPage {


  constructor() {
    
    const api = new WooCommerceRestApi({
      url: 'http://localhost/wordpress',
      consumerKey: 'my consumerkey',
      consumerSecret: 'my secretkey',
      version: 'wc/v3'
    });
    
   }
  ngOnInit() {

and I received this error

ERROR Error: Uncaught (in promise): ReferenceError: Cannot access 'ProductlistPageModule' before initialization
ReferenceError: Cannot access 'ProductlistPageModule' before initialization

I guess I missing something …

Regards

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
guntercncommented, Jan 5, 2020

Hi. I could not make this plugin work with IONIC 4

i use woocommerce-api and works fine!!

npm i woocommerce-api

https://www.npmjs.com/package/woocommerce-api

must update a file @angular-devkit/build-angular/src/angular-cli-files/models/webpack-configs/browser.js

line 91 node: false, to node: { crypto: true, stream: true, fs: “empty”, net: “empty”, tls: “empty” },

1reaction
pohengcommented, Mar 31, 2020

yes I know that too, but I want to make it work with the new package as the package is marked as obsolete and will not received any update

Read more comments on GitHub >

github_iconTop Results From Across the Web

Build Your First Ionic Mobile App: Angular Development Tutorial
Ionic's single codebase builds for any platform using just HTML, CSS, & JavaScript. Develop your first mobile app with our step-by-step Angular tutorial....
Read more >
Ionic 4 & Angular Tutorial For Beginners - Crash Course
Learn to build iOS, Android and web apps from scratch with Ionic 4 and Angular!Join the full Ionic + Angular course: ...
Read more >
Ionic Framework 4 - Full Tutorial - iOS / Android ... - YouTube
Learn how to use Ionic 4 in this full tutorial course for beginners. Ionic Framework is the free, open source mobile UI toolkit...
Read more >
Ionic 4 Crash Course for Beginners - Build an App - YouTube
https://skl.sh/designcourse20 - First 500 people to sign up will get their first 2 months free!https://designcourse.com - Learn UI/UX from ...
Read more >
Complete IONIC 4 Tutorial for Beginners in One Video
Key moments. View all · run your server on ionic lab · run your server on ionic lab · run your server on...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found