Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 16:06

    julienrf on master

    Release version 0.16.0 (compare)

  • 16:06

    julienrf on v0.16.0

    Release version 0.16.0 (compare)

  • 15:56

    julienrf on gh-pages

    updated site (compare)

  • 14:40

    julienrf on master

    Replace ScalaTest by JUnit in a… Merge pull request #317 from sj… (compare)

  • 14:40
    julienrf closed #317
  • 12:18
    cquiroz commented #317
  • 10:07
    sjrd review_requested #317
  • 10:07
    sjrd opened #317
  • 10:01
    julienrf closed #300
  • 10:01
    julienrf commented #300
  • 10:00

    julienrf on master

    Upgrade to Scala.js 1.0.0-RC1 (… Merge pull request #316 from sj… (compare)

  • 10:00
    julienrf closed #316
  • Dec 04 16:32
    sjrd commented #316
  • Dec 04 16:30
    julienrf commented #316
  • Dec 04 16:12
    sjrd commented #316
  • Dec 04 16:04
    sjrd synchronize #316
  • Dec 04 13:39
    sjrd synchronize #316
  • Dec 04 13:08
    julienrf commented #316
  • Dec 04 13:07
    sjrd commented #316
  • Dec 04 13:06
    sjrd review_requested #316
nkgm
@nkgm
Of course now it works, and I'm embarassed :)
Intellij kept choking on this dependency (using sbt shell for builds and imports), so I went back and did a full reimport in order to enable sbt sources to better troubleshoot this issue, and apparently that's all it took
Julien Richard-Foy
@julienrf
no worries ;)
moritz bust
@busti

I deleted my local project folder by mistake yesterday and had to clone it again. Nothing was lost in the process, but , obviously,I had to install everything cleanly. The project was working perfectly fine before, but now it won't build anymore.
When I try to run fastOptJS::webpack I get the following error:

[error] ModuleNotFoundError: Module not found: Error: Can't resolve 'perf_hooks'
[...] // repetitions of the same error for multiple locations and extensions
no extension
[error]               Field 'browser' doesn't contain a valid alias configuration
[error]               C:\Users\mbust\Documents\projects\<project-name>\modules\client\target\scala-2.12\scalajs-bundler\main\node_modules\perf_hooks doesn't exist

perf_hooks is supposed to be included in node itself. I am on the latest version of nodejs and I also checked if I can require('perf_hooks'), which I can. I tried manually installing the npm package of the same name, but it is just a placeholder for the namespace and thus empty.

I am on sbt 1.2.8, on scalajs 0.6.28 and on scalajs-bundler 0.15.0-0.6.
I am using a custom webpack config, which configures the webpack dev server and sets up sass files and some other resources. I have included the necessary files as npm dev dependencies.
I have also added some folders in my project root as resource folders.
Has anyone else experienced this before? I am pretty much clueless by now. I have tried everything that came to my mind for several hours, i.e. updating version numbers, using and/or reinstalling node, npm and yarn, removing non essential stuff from my webpack config and so on.
moritz bust
@busti
I have been playing with it for some more time. It looks like webpack cannot find any native module.
When I manually remove any reference to perf_hooks, it complains about not being able to find fs, which arguably is a pretty integral part of nodejs.
moritz bust
@busti
Could all of this mean that it is trying to build for node (backend) instead of the browser (frontend)? I do not have anything like that specified in my webpack config. The webpack documentation also states that the default target is web.
Again, I never ran into it before, which is odd, since my settings have not changed.
Also, the project is not very old. Even if there was something in the build folder that was never cleaned since it was first working, it wasn't any older than 3 weeks.
moritz bust
@busti
Okay, so I have opened up another project that I haven't had open for a while, that definitely worked before, and ran clean and then fastOptJS::webpack and now it suffers from the same exact problem.
moritz bust
@busti
[Fixed] Okay, it seems like one of the scalajs libraries I am using is responsible for this. It will still be hard to narrow down the problem, but for now I can downgrade to make the problem go away. I will discuss this further in the libraries channel.
Mustafa Kuscu
@mcku

In my build webpack step takes long time.
GCC takes 200 seconds (which is OK) whose output is about 7 MB (not that big I guess). Webpack takes much much longer, more than 15 minutes.

Given the structure of the default webpack config, I suppose webpack would just bundle the external requires but would not do any optimizations. Therefore I was expecting it to finish its job quicker.

Why would the webpack step take so long, any ideas?

Mustafa Kuscu
@mcku

I think found why that was happening. Webpack, by default, uses production mode. mode is specified in scalajs.webpack.config in development build, i mean during fastOptJS, but not in fullOptJS.

Therefore the proj-opt.js, which was already GCC-optimized, goes through another phase of optimization, as per webpack documentation here: https://webpack.js.org/configuration/mode/

Mustafa Kuscu
@mcku
i think just disabling the minimize flag in module.exports.optimizations is sufficient to avoid that.. but then the npmDependencies are not being minified..
Mustafa Kuscu
@mcku
then resolve.alias helps in this situation by resolving to vendor-minified js sources
nkgm
@nkgm
any idea how to go about importing tailwindcss into my build?
moritz bust
@busti
@nkgm
You have to have css module loaders added via npm and defined in your webpack.config.js then in your scala application object you do
@js.native
@JSImport("tailwindcss/base", JSImport.Namespace)
object TailwindBase extends js.Object  

object Main extends App {
  private var tailwindbase = TailwindBase
}

While we are on the topic of importing webpack modules, how do I do it without having an unused var defined?
Matt Hughes
@matthughes
Is there any way to tell what npm/node are doing? When my build gets the the part where it runs npm/node, it spawns like ten node processes and npm and then just sits there. CPU does nothing and eventually returns but what is it doing?
 | |             |--- 91485 mhughe008 npm
 | |             |--- 91686 mhughe008 node
 | |             |--- 91727 mhughe008 node
 | |             |--- 91728 mhughe008 node
 | |             |--- 91729 mhughe008 node
 | |             |--- 91730 mhughe008 node
 | |             |--- 91731 mhughe008 node
 | |             |--- 91732 mhughe008 node
 | |             |--- 91733 mhughe008 node
 | |             |--- 91741 mhughe008 node
 | |             |--- 91746 mhughe008 node
 | |             \--- 91749 mhughe008 node
Is there some jstack equivalent for node?
Matt Hughes
@matthughes
Hmm it seems the 10 node processes are from scalajs for testing, not scalajs-bundler is that correct? And they just spawn them super early in the process so it looks like they are not making progress.
Julien Richard-Foy
@julienrf
I don’t think scalajs-bundler spawns these processes, maybe ask on the scala-js channel?
Matt Hughes
@matthughes
thx
elyphas
@elyphas
hi, someone could tell me, please, why I get this error:
build.sbt:101: error: not found: value requireJsDomEnv
    requireJsDomEnv in Test := true,
I want to make a test in my client side project
Julien Richard-Foy
@julienrf
which version of scalajs-bundler do you use?
elyphas
@elyphas
@julienrf ; addSbtPlugin("ch.epfl.scala" % "sbt-web-scalajs-bundler" % "0.13.1")
Julien Richard-Foy
@julienrf
requireJsDomEnv has been introduced in 0.14.0
Can you upgrade to a more recent version?
Otherwise, you can use the old way: requiresDOM in Test := true
elyphas
@elyphas
the thing is I have: addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.29" )
is compiling,
:)
with requireJsDomEnv
elyphas
@elyphas

i have this error:

/home/elyphas/Prjs/tsoolik/client/target/scala-2.12/scalajs-bundler/test/node_modules/webpack-cli/bin/webpack.js:237
[error]                 throw err;
[error]                 ^
[error] Error: Cannot find module './scalajs.webpack.config'

this seems it must be generated by scalajs-bundler so I have a bad config, what could it be?

elyphas
@elyphas
I updated to:
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.31" )
addSbtPlugin("ch.epfl.scala" % "sbt-web-scalajs-bundler" % "0.15.0-0.6")
elyphas
@elyphas
problem continue, :)
elyphas
@elyphas
I think is solved, sorry, I had mixed everything.
elyphas
@elyphas
Hi, someone could tell me, please.
Why I am getting this error in my tests:
~client/test
Error: Uncaught [TypeError: Cannot read property 'bind' of undefined]
    at reportException (/home/elyphas/Prjs/tsoolik/client/target/scalajs-bundler-jsdom/node_modules/jsdom/lib/jsdom/living/helpers/runtime-script-errors.js:58:24)
    at processJavaScript (/home/elyphas/Prjs/tsoolik/client/target/scalajs-bundler-jsdom/node_modules/jsdom/lib/jsdom/living/nodes/HTMLScriptElement-impl.js:130:7)
    at HTMLScriptElementImpl._eval (/home/elyphas/Prjs/tsoolik/client/target/scalajs-bundler-jsdom/node_modules/jsdom/lib/jsdom/living/nodes/HTMLScriptElement-impl.js:65:7)
    at /home/elyphas/Prjs/tsoolik/client/target/scalajs-bundler-jsdom/node_modules/jsdom/lib/jsdom/browser/resource-loader.js:31:22
    at Object.check (/home/elyphas/Prjs/tsoolik/client/target/scalajs-bundler-jsdom/node_modules/jsdom/lib/jsdom/living/nodes/Document-impl.js:88:11)
    at /home/elyphas/Prjs/tsoolik/client/target/scalajs-bundler-jsdom/node_modules/jsdom/lib/jsdom/living/nodes/Document-impl.js:107:12
    at wrappedEnqueued (/home/elyphas/Prjs/tsoolik/client/target/scalajs-bundler-jsdom/node_modules/jsdom/lib/jsdom/browser/resource-loader.js:255:16)
    at ReadStream.<anonymous> (/home/elyphas/Prjs/tsoolik/client/target/scalajs-bundler-jsdom/node_modules/jsdom/lib/jsdom/browser/resource-loader.js:76:7)
    at ReadStream.emit (events.js:215:7)
    at endReadableNT (_stream_readable.js:1199:12) TypeError: Cannot read property 'bind' of undefined
    at eval (webpack:///./node_modules/snabbdom/modules/style.js?:4:76)
    at Object../node_modules/snabbdom/modules/style.js (file:///home/elyphas/Prjs/tsoolik/client/target/scala-2.12/scalajs-bundler/test/client-test-fastopt-bundle.js:237:1)
    at __webpack_require__ (file:///home/elyphas/Prjs/tsoolik/client/target/scala-2.12/scalajs-bundler/test/client-test-fastopt-bundle.js:20:30)
    at Object.eval (webpack:///./client-test-fastopt.js?:1092:41)
    at eval (webpack:///./client-test-fastopt.js?:145715:30)
    at Object../client-test-fastopt.js (file:///home/elyphas/Prjs/tsoolik/client/target/scala-2.12/scalajs-bundler/test/client-test-fastopt-bundle.js:93:1)
    at __webpack_require__ (file:///home/elyphas/Prjs/tsoolik/client/target/scala-2.12/scalajs-bundler/test/client-test-fastopt-bundle.js:20:30)
    at eval (webpack:///./client-test-fastopt-loader.js?:2:12)
    at Object../client-test-fastopt-loader.js (file:///home/elyphas/Prjs/tsoolik/client/target/scala-2.12/scalajs-bundler/test/client-test-fastopt-bundle.js:81:1)
    at __webpack_require__ (file:///home/elyphas/Prjs/tsoolik/client/target/scala-2.12/scalajs-bundler/test/client-test-fastopt-bundle.js:20:30)
dejvid
@dejvid

Hi everyone.
I am trying to build scalajs-bundler plugin with the latest scalajs plugin. I am totally new here so I am little lost. I have forked the project, and started from the master branch.

I have tried to build scalajs-bundler with scala 1.0.0-RC1 and I get the following error when executing this command SCALAJS_VERSION=1.0.0-RC1 sbt ^^1.3.4 runScripted:

snet@snet-Z370P-D3:~/Documents/razvoj/scalajs-bundler$ SCALAJS_VERSION=1.0.0-RC1 sbt ^^1.3.4 runScripted
[info] Loading global plugins from /home/snet/.sbt/0.13/plugins
[info] Loading project definition from /home/snet/Documents/razvoj/scalajs-bundler/project
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
[info] Set current project to scalajs-bundler (in build file:/home/snet/Documents/razvoj/scalajs-bundler/)
[info] Setting `sbtVersion in pluginCrossBuild` to 1.3.4
[info] Set current project to scalajs-bundler (in build file:/home/snet/Documents/razvoj/scalajs-bundler/)
[info] Skipping sbt-web-scalajs-bundler/play since it requires sbt 0.13
[info] Skipping sbt-scalajs-bundler/custom-test-config_sjs-0.6 since it requires Scala.js 0.6
[info] Skipping sbt-scalajs-bundler/webpack-assets-cookbook_sjs-0.6 since it requires Scala.js 0.6
[info] Skipping sbt-scalajs-bundler/global-namespace-with-jsdom-unit-testing_sjs-0.6 since it requires Scala.js 0.6
[warn] No tests can be run for this sbt version
[info] Skipping sbt-scalajs-bundler/global-namespace_sjs-0.6 since it requires Scala.js 0.6
[info] Skipping sbt-scalajs-bundler/sbt-0.13.x since it requires sbt 0.13
[info] Packaging /home/snet/Documents/razvoj/scalajs-bundler/sbt-scalajs-bundler/target/scala-2.12/sbt-1.0/sbt-scalajs-bundler-0.15.0+8-d73fdcb1+20191208-2005-sources.jar ...
[info] Updating {file:/home/snet/Documents/razvoj/scalajs-bundler/}sbt-scalajs-bundler...
[info] Done packaging.
[info] Wrote /home/snet/Documents/razvoj/scalajs-bundler/sbt-scalajs-bundler/target/scala-2.12/sbt-1.0/sbt-scalajs-bundler-0.15.0+8-d73fdcb1+20191208-2005.pom
[info] Done updating.
[info] :: delivering :: ch.epfl.scala#sbt-scalajs-bundler;0.15.0+8-d73fdcb1+20191208-2005 :: 0.15.0+8-d73fdcb1+20191208-2005 :: integration :: Sun Dec 08 20:05:25 CET 2019
[info]  delivering ivy file to /home/snet/Documents/razvoj/scalajs-bundler/sbt-scalajs-bundler/target/scala-2.12/sbt-1.0/ivy-0.15.0+8-d73fdcb1+20191208-2005.xml
[info] Main Scala API documentation to /home/snet/Documents/razvoj/scalajs-bundler/sbt-scalajs-bundler/target/scala-2.12/sbt-1.0/api...
[info] Compiling 29 Scala sources to /home/snet/Documents/razvoj/scalajs-bundler/sbt-scalajs-bundler/target/scala-2.12/sbt-1.0/classes...
[error] /home/snet/Documents/razvoj/scalajs-bundler/sbt-scalajs-bundler/src/main/scala-sjs-1.x/scalajsbundler/JSDOMNodeJSEnv.scala:14: object io is not a member of package org.scalajs
[error] /home/snet/Documents/razvoj/scalajs-bundler/sbt-scalajs-bundler/src/main/scala-sjs-1.x/scalajsbundler/JSDOMNodeJSEnv.scala:14: object io is not a member of package org.scalajs
[error] import org.scalajs.io._
[error] import org.scalajs.io._
[error]                    ^
[error]                    ^

and bunch of other errors, but my question is where did org.scalajs.io._ dependency disappeared? Was it a part of scalajs plugin or..? Was it moved to seperate library, deprecated? Please help.

Julien Richard-Foy
@julienrf
Hello @dejvid, Scala.js 1.0.0-RC1 is not supported yet by scalajs-bundler. There is PR for this (#316) that should be merged soon.
dejvid
@dejvid
I know it's not, I just wanted to make it compatible, but if there is already PR then I'll just wait :)
Julien Richard-Foy
@julienrf
Sébastien Doeraene
@sjrd
Thank you @julienrf !
nafg
@nafg
:clap:
Carlos Quiroz
@cquiroz
Thanks!
Ramnivas Laddad
@ramnivas
:clap:
Lorenzo Gabriele
@lolgab
Good job guys :clap: :clap: :clap: :clap: