TypeError: Cannot read property 'split' of undefined #755
-
Issue summarywhen I do npm run dev at terminal it returns a TypeError : TypeError: Cannot read property 'split' of undefined
|
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 1 reply
-
I experienced the same problem following the Build a Shopify App with Node and React tutorial in Step 3. Resolved it by:
|
Beta Was this translation helpful? Give feedback.
-
Also having this issue
This did not resolve. Should I add a var to the .env? |
Beta Was this translation helpful? Give feedback.
-
Hey everyone! That error could be due to a number of different reasons, but if you just checked out this repo and ran it, it is possible that you're missing a
If this isn't the issue you're facing, can you please share the code from Hope this helps! |
Beta Was this translation helpful? Give feedback.
-
I had this same problem but realized that I didn't have a |
Beta Was this translation helpful? Give feedback.
-
Im having this issue as well. I wil attach my server.js file. `require('isomorphic-fetch'); dotenv.config(); Shopify.Context.initialize({ const port = parseInt(process.env.PORT, 10) || 3000; const ACTIVE_SHOPIFY_SHOPS = {}; app.prepare().then(() => { server.use(
); const handleRequest = async (ctx) => { router.get("/", async (ctx) => {
}); router.get("(/_next/static/.)", handleRequest); server.use(router.allowedMethods()); server.listen(port, () => { |
Beta Was this translation helpful? Give feedback.
-
I had this same issue and the problem was that in a secret I had in the .env file the value contained $ when I removed this character it worked |
Beta Was this translation helpful? Give feedback.
Hey everyone! That error could be due to a number of different reasons, but if you just checked out this repo and ran it, it is possible that you're missing a
.env
file, which will need the following values:If this isn't the issue you're facing, can you please share the code from
server.js
around the error, so we can see if it is a bug in the app?Hope this helps!