Fork me on GitHub
#shadow-cljs
<
2018-10-08
>
mynomoto01:10:25

@vigilancetech you could not use .hl files and have no problems with compiling them. That's how I was using hoplon.

eoliphant16:10:03

Hi. I seem to have run into issues with more recent versions of AWS amplify. Using aws-amplify-react 2.0.7 and shadow 2.6.10 requiring this ["aws-amplify-react" :refer [Authenticator]] causes this:

The required JS dependency "babel-runtime/helpers/extends" is not available, it was required by "node_modules/aws-amplify-react/dist/AmplifyUI.js".

Searched in:/Users/ErichOliphant/Documents/projects/sqd/node_modules

You probably need to run:
  npm install babel-runtime/helpers/extends
The transpiled AmplifyUI.js has the following
...
var _extends2 = require('babel-runtime/helpers/extends');


But the babel runtime package has the preceding @ in node_modules which I presume is the problem. Why can't everyone just use clojurescript.. Ugh...

thheller17:10:14

@eoliphant this might just be a version conflict. check if node_modules/babel-runtime exists?

thheller17:10:44

babel v7 switched to using @babel/... scoped packages

thheller17:10:05

but the old version should still be installed, just might be getting installed in a nested folder?

eoliphant17:10:07

ah hell. totally misread that

eoliphant17:10:31

yeah what's there now is @babel/runtime/...

thheller17:10:59

but since its a new package the old one should still be available?

eoliphant17:10:24

also trying to look at who's pulling the newer one in

eoliphant17:10:06

i'm not grabbing it explicitly

eoliphant17:10:17

semantic-ui-react

eoliphant17:10:27

requires ^7.0.0

thheller17:10:42

but that has different packages

thheller17:10:53

the OLD packages will not conflict with the new ones

eoliphant17:10:57

ah i see what you're saying

eoliphant17:10:05

because the pkg name is entirely different

thheller17:10:16

if in doubt just rm -rf node_modules and npm install

eoliphant17:10:18

the 'new and improved' amplify setup

eoliphant17:10:27

acutalyl has you do some wacky stuff by hand

eoliphant17:10:46

before you actually npm install the packages themselve

eoliphant17:10:02

i just ignored it

thheller17:10:35

npm WARN [email protected] requires a peer of aws-amplify@^1.x but none is installed. You must install peer dependencies yourself.

thheller17:10:41

did you install that?

thheller17:10:09

compiles fine for me when I npm install aws-amplify aws-amplify-react

eoliphant17:10:28

they have you create this seed file with the scripts and dev deps first, then you install amplify but in any case will try just installing babel-runtime by hand

eoliphant17:10:41

I did npm install aws-amplify aws-amplify-react

thheller17:10:25

you likely just have a dependency conflict somewhere

thheller17:10:42

check FIRST if node_modules/babel-runtime exists and is NOT empty (it might be)

thheller17:10:11

THEN check if node_modules/aws-amplify-react/node_modules/babel-runtime exists and is not empty

thheller17:10:32

if THAT exists you have a version conflict somewhere

eoliphant17:10:33

ah no I didn't lol. ugh. Been working for about 18 hrs straight probably time for a break. I only did amplify-react..

thheller17:10:26

there is a command to list dependency conflicts but I forgot what it was

eoliphant17:10:27

but hmm that didn't help there's still no node_modules/babel-runtime And the only thing under node_modules/aws-amplify-react/node_modules is regenerator-runtime whatever that is

eoliphant17:10:51

gonna try blowing node_modules away

thheller17:10:35

what happens if you just install it?

thheller17:10:40

if it doesn't exist you can just isntall it?

eoliphant17:10:49

yeah will try that next

eoliphant17:10:59

already blew away node_modules

eoliphant17:10:06

if that doens't work will add it by hand

thheller17:10:33

oh shit I think I know what might be happening

thheller17:10:50

hmm no it just doesn't declare the dependency

thheller17:10:22

just npm install babel-runtime should fix it

4
thheller17:10:33

I just had it installed because some other package was using it

kanwei17:10:13

@thheller yeah that infinite loop seems to fit the description of what i was seeing - thanks

eoliphant18:10:56

Thanks @thheller.. yeah again.. why can't everyone just use cljs lol

eoliphant18:10:33

Hey I'm also having this problem again (https://github.com/thheller/shadow-cljs/issues/228) pulling in auth0-js with :default or :as results in a nil symbol

thheller18:10:44

@eoliphant their minified packaging seems to do really weird stuff to the code that may trip up the closure compiler

thheller18:10:59

(:require ["auth0-js/dist/auth0.js" :as auth0]) seems to work fine

eoliphant18:10:08

it's always something lol

thheller18:10:11

you should be getting a warning in the browser console

eoliphant18:10:12

will try that

eoliphant18:10:41

yeah was getting this ' Cannot read property 'lib' of undefined'

eoliphant18:10:57

shadow.js.js:88 Uncaught TypeError: Cannot read property 'lib' of undefined
    at auth0.min.js:9
    at auth0.min.js:9
    at createCommonjsModule (auth0.min.js:9)
    at auth0.min.js:9
    at auth0.min.js:9
    at Object.shadow$provide.module$node_modules$auth0_js$dist$auth0_min (auth0.min.js:9)
    at Object.shadow.js.jsRequire (shadow.js.js:85)
    at Object.shadow.js.require (shadow.js.js:111)
    at sqd.ui.components.auth0.js:5

thheller18:10:54

yeah the minified package is just weird