Code Monkey home page Code Monkey logo

Comments (5)

nozzlegear avatar nozzlegear commented on June 8, 2024

Hey Tony, I'm seeing webpack in your errors. Just to be clear, are you using this lib from the browser side or server side?

from shopify-prime.

SplayConsulting avatar SplayConsulting commented on June 8, 2024

Browser side.
Once I comment out this line..
const shop: any = await new Shops(this.shop, this.appState.get('access_token')).get(xxxxxx);
the error goes away.

from shopify-prime.

TonyCasey avatar TonyCasey commented on June 8, 2024

2017-05-22 19_00_10-smiley feedback admin

from shopify-prime.

nozzlegear avatar nozzlegear commented on June 8, 2024

Okay, I see what's going on here thanks to your screenshot! Shopify Prime was built to run in a Node server, not on the browser. It tries to load the package.json from it's npm folder so it can figure out which version it's using, but that package.json isn't going to be there on the browser side.

There are better ways to get a version without loading package.json, so I'll make sure this gets fixed and published as soon as possible. However, the last time I tried it the Shopify API didn't allow requests from the browser (it disallows CORS requests), so I'm not sure that Shopify Prime will work in the browser even with this fix, unless they've changed that recently.

from shopify-prime.

TonyCasey avatar TonyCasey commented on June 8, 2024

Very good, that makes sense.

You are right on the CORS issue, that was what got me searching for a library that might have a solution for it. I've read it can work using jsonP, so I'll have a look at that again, if not, I might do a combination of client & server.
Thanks for investigating

from shopify-prime.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.