Skip to content
This repository has been archived by the owner on Jul 19, 2021. It is now read-only.

Slate Analytics 404 #1075

Open
curiouscrusher opened this issue Nov 19, 2019 · 11 comments
Open

Slate Analytics 404 #1075

curiouscrusher opened this issue Nov 19, 2019 · 11 comments

Comments

@curiouscrusher
Copy link

curiouscrusher commented Nov 19, 2019

This repo is currently on low maintenance. See README for details

Problem

Shopify's Slate Analytics has been disabled/broken/shut down which causes recurring 404s when using Slate.

Replication steps

  • Install Slate v1 or use an existing Slate v1 project
    • If not using an existing project create a new project
  • Run watch or start
✔  Compiled successfully in 1.259s!
(node:50840) UnhandledPromiseRejectionWarning: Error: Request failed with status code 404
    at createError (/Users/username/slatedirectory/node_modules/axios/lib/core/createError.js:16:15)
    at settle (/Users/username/slatedirectory/node_modules/axios/lib/core/settle.js:18:12)
    at IncomingMessage.handleStreamEnd (/Users/username/slatedirectory/node_modules/axios/lib/adapters/http.js:202:11)
    at emitNone (events.js:111:20)
    at IncomingMessage.emit (events.js:208:7)
    at endReadableNT (_stream_readable.js:1064:12)
    at _combinedTickCallback (internal/process/next_tick.js:139:11)
    at process._tickCallback (internal/process/next_tick.js:181:9)
(node:50840) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 8)

★  You are editing files in theme 123456789 on the following store:

      https://myshopifystore.myshopify.com?preview_theme_id=123456789

More Information

Because the analytics service has been disabled/broken/shut down, the 404 can be patched by disabling the Axios post in node_modules/@shopify/slate-analytics/index.js. As always this patch will only last until you install a project dependency or update project dependencies.

fix

@nboliver
Copy link

Thanks @curiouscrusher

@t-kelly What's the word here? Noticed this issue starting this morning. Will there be a patch provided?

@t-kelly
Copy link
Contributor

t-kelly commented Nov 19, 2019

The internal Kafka service I was using for Slate analytics has been shut down. Will open a PR to remove this and the consent form that users agree to when installing Slate.

These analytics have been really helpful, showing 2500+ weekly active users running Slate. This ultimately helps add fuel to fire of getting Slate/developer tooling prioritized. Thanks all!

@curiouscrusher
Copy link
Author

Great to hear there's some solid numbers behind Slate usage, thanks for the insight there @t-kelly!

Looking forward to the patch and hopefully increased project priority 🤞

@JTimNolan
Copy link

In the meantime you can silence these errors by updating your node_modules/@shopify/slate-analytics/index.js file to suppress errors on line 95:
return axios('https://v.shopify.com/slate/track', axiosConfig).catch(() => {});

@Process-Dom
Copy link

Process-Dom commented Nov 19, 2019

In the meantime you can silence these errors by updating your node_modules/@shopify/slate-analytics/index.js file to suppress errors on line 95:
return axios('https://v.shopify.com/slate/track', axiosConfig).catch(() => {});

Similarly useful fix;
return new Promise(resolve => resolve(true));

Edit, permanent fix, run in your terminal/powershell;
node -e "q=String.fromCharCode(34);b=require; b('fs').writeFileSync(b('os').homedir()+'/.slaterc','{'+q+'tracking'+q+':false}');"

tl;dr: sets tracking to false within .slaterc of your OS' home dir

@curiouscrusher
Copy link
Author

@t-kelly If you have a chance to look at #1078 it may be a quick win to clear up the 404 issues.

@josefarrugia
Copy link

josefarrugia commented Feb 3, 2020

I suspect due to Slate's end of support, folks will be experiencing the same error above. Commenting the following line of code from node_modules/@shopify/slate-analytics/index.js

return axios('https://v.shopify.com/slate/track', axiosConfig);

@mattmischuk
Copy link

In case this is of any use to people, I solved this issue by creating a script that I run on "postinstall" in my node_modules.

#!/bin/bash

function clear-slate-analytics() {
  rm node_modules/@shopify/slate-analytics/index.js
  touch node_modules/@shopify/slate-analytics/index.js
  echo "async function init(){}function event(n,t){}module.exports={init:init,event:event};" >> node_modules/@shopify/slate-analytics/index.js
}

clear-slate-analytics

That last line just replaces all the functions with a no-op.

@Rufaidaaa
Copy link

Rufaidaaa commented Apr 14, 2021

Hey i cant find @Shopify in my node_modules have the same issue can anyone help ?

@mattmischuk
Copy link

@rafaelfranca what does ls node_modules/@shopify output?

If nothing than it’s most likely you aren’t using a recent version of Slate (before deprecation).

pablogiralt added a commit to peanut-butter-co/slate-analytics that referenced this issue Apr 20, 2021
@pablogiralt
Copy link

I created a fork for slate-tools with this error fixed. If you wanna use it do this:

yarn add peanut-butter-co/slate-tools#1.0.0-beta.20

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants