Jump to content
Search Community

GSAP private module + Netlify + yarn

Jung von Matt NECKAR test
Moderator Tag

Recommended Posts

2 hours ago, elegantseagulls said:

I'm having this issue as well, but cannot upgrade to berry due to other dev reqs. Anyone else find other work-arounds?

Any ideas @Prasanna

 

Other than using the .tgz file from the zip download instead of the private NPM repo, I'm not sure what else to recommend. 

  • Like 1
Link to comment
Share on other sites

On 5/4/2021 at 10:58 PM, elegantseagulls said:

I'm having this issue as well, but cannot upgrade to berry due to other dev reqs. Anyone else find other work-arounds?

 

One workaround is to use the npm package as is. For example:

$ npm install @gsap/shockingly

 

But then you need to import the package like this:

import { gsap } from '@gsap/shockingly'

 

 

  • Like 1
Link to comment
Share on other sites

  • 1 month later...

I also had this issue, and switching to npm is not viable for me.
 

I ended up pulling the "private" file I needed from the esm folder of the download provided when becoming a club member, placing it in the repo, and importing it into my component. Then just installed gsap normally `yarn add gsap`. The upside to this is there are no more 403 permission issues since I'm not fetching a private module, the downside is it's tougher to get updates. But honestly this is a worthy tradeoff to me since literally everything else I tried failed.

Link to comment
Share on other sites

  • 3 weeks later...
14 hours ago, GreenSock said:

Not that I'm aware of - @Prasanna, have you heard anything? This isn't something on our end - it's more of a Yarn thing from what I understand, so there's really nothing we can do. Sorry, @monolith 

 

I'm not too sure this issue comes from Yarn.

See I was already working with private NPM packages using Yarn without issues.

 

Problems started to surface only after adding GSAP.

 

@Prasanna I've been wanting to play around with Yarn Berry for a while, but it's not really a possibility in my current stack.

Link to comment
Share on other sites

  • 2 weeks later...

Hey all, apologies for the delay in my response - I was out travelling last week.

 

The problem with yarn classic is that `$yarn install` might not work with package name aliases. So this means:
* $yarn add gsap@npm:@gsap/shockingly -> this works

* import GSAP from 'gsap' -> this works

 

But, if you run $ rm -rf node_modules and then run $ yarn install - the installation fails. This is because yarn classic has an active bug with package name aliases which defaults to the default npm registry.

 

So, as a workaround you can do either of these:

1. Do not use package name alias: $ yarn add @gsap/shockingly -> and then import GSAP from '@gsap/shockingly'

2. Set the global registry to Greensock: $npm config set registry https://npm.greensock.com and follow the rest of the instructions specified: https://greensock.com/docs/v3/Installation#private

 

 

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

  • 3 months later...

Hi @prasanna - I'm following this up with Maël - the maintainer of yarn. 

I'm finding it quite hard to follow the thread of the issue(s?) here. It seems like there are a few different ones?
 

On 7/8/2021 at 10:39 PM, Prasanna said:

This is because yarn classic has an active bug with package name aliases which defaults to the default npm registry.

Do you possibly have a link to the active issue on github?

Is this issue related? 

https://github.com/yarnpkg/berry/issues/2306

@Puneet - could you add the steps necessary to replicate your issue to your post please? Thank you!

 

Link to comment
Share on other sites

5 hours ago, Puneet Sharma said:

Hi @Prasanna
 

I tried both methods mentioned in your last comment but none of them work for me.
I'm still getting that 403 Error.

 

Hi @Puneet, did you try either one of the methods mentioned in this comment:

 

 

 

Quote

 

You can use either of this as a workaround:

1. Do not use package name alias: $ yarn add @gsap/shockingly -> and then import GSAP from '@gsap/shockingly'

OR

2. Set the global registry to Greensock: $npm config set registry https://npm.greensock.com and follow the rest of the instructions specified: https://greensock.com/docs/v3/Installation#private

 

 

 

  • Like 1
Link to comment
Share on other sites

Yes. Sure @Cassie

I have cloned the code from github repo to my local system where GSAP ShockinglyGreen Plugin is already installed. Now,
1. When I'm running yarn install, I'm getting 403 error.
2. If I try to install ShockinglyGreen Plugin using the command yarn add gsap@npm:@gsap/shockingly , I'm, getting 403 error

Yes @Prasanna, I tried the methods mentioned here
With Method 1, I'm getting this error:
image.thumb.png.52d45d02d18df94459098d4ae4256346.png

 

With Method 2:

I had removed @gsap:registry=https://npm.greensock.com  from .npmrc file and run the command below

 

image.png.c2b98379641fc72cf9829f4f8e57e18b.png

 

After that I followed the steps mentioned here


image.thumb.png.c8152e35adcea7b30f3923f5aaabbcd2.png

 

Getting Request failed: 403 forbidden Error with both methods.

 

Link to comment
Share on other sites

  • 1 month later...

@Prasanna - Ryan @elegantseagulls , and a few other people are still having issues here.

I couldn't get it deployed on Netlify either - Do you have an example site you've managed to deploy?

Additionally if you have any information I can take to Netlify or yarn that would be great.

I tried here https://answers.netlify.com/t/issues-deploying-with-yarn-and-private-gsap-registry/46414

But it wasn't very fruitful, and frankly I think the yarn discord is sick of me. So any help would be appreciated.

Apparently this issue is now with Vercel as well as Netlify. These are very commonly used and we can't just keep reviving this thread. There's got to be something that's getting lost in translation here.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...