Comments (5)
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.
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.
from shopify-prime.
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.
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)
- Question: Webhook validation HOT 2
- Better tests! HOT 4
- Support price rules api HOT 3
- Replace node-fetch with got
- Don't try to read the package.json
- Can we get a new release? HOT 3
- Issue verifying webhook: app/uninstalled HOT 4
- Embedded rate limiting HOT 2
- Running the build npm script HOT 11
- Looking for maintainers! HOT 1
- Add customer API HOT 1
- Question: How to use Authscope type? HOT 3
- Remove the published prop from CustomCollection
- Add a helper function for making requests with a leaky bucket policy HOT 2
- Generated code obscures error stack trace HOT 1
- Support the Application Credit API HOT 1
- Support the [Online Access] and [Offline Access] oauth types HOT 1
- Add documentation for discounts, gift cards and redirects.
- Script bin invocations error HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shopify-prime.