webjars / webjars-play

MIT License
80 stars 34 forks source link

Error Migrating from Play 2.5 -> 2.6 #87

Closed bravegag closed 9 months ago

bravegag commented 5 years ago

When migrating from Play 2.5 -> 2.6 I get the following error:

[error] /home/bravegag/code/play-authenticate-usage-scala/conf/routes:55: type WebJarAssets is not a member of package controllers [error] GET /webjars/file controllers.WebJarAssets.at(file) [error] /home/bravegag/code/play-authenticate-usage-scala/conf/routes:55: type WebJarAssets is not a member of package controllers [error] GET /webjars/file controllers.WebJarAssets.at(file) [error] /home/bravegag/code/play-authenticate-usage-scala/conf/routes:55: type WebJarAssets is not a member of package controllers [error] GET /webjars/*file controllers.WebJarAssets.at(file)

You can find my build.sbt migration commit here with all changes: https://github.com/bravegag/play-authenticate-usage-scala/commit/9245aa25469826658b986e8fbc277c7b0e3570ce#diff-fdc3abdfd754eeb24090dbd90aeec2ce

Additionally you may also clone and reproduce from here: https://github.com/bravegag/play-authenticate-usage-scala/tree/migrate-play-2.6

How can I fix this?

jamesward commented 5 years ago

There were some API changes for 2.6. I've commented on how to change the routes but you'll also need to update usage of the locator, for example:

@this(webJarsUtil: org.webjars.play.WebJarsUtil)

@webJarsUtil.locate("bootstrap.min.css").css()
@webJarsUtil.locate("bootstrap.min.js").script()

Sorry for the hassle. Let me know if I can help.

mkurz commented 9 months ago

I think this can be closed. Play 2.5 and 2.6 are very legacy now and people will find this issue anyway when searching this repo or google or bing or... chatgpt :wink: ?