Tapestry 5.4 Beta 22: Supposed directory structure for modules used by requirejs

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Tapestry 5.4 Beta 22: Supposed directory structure for modules used by requirejs

samt & sonders
hi,

I'm trying to upgrade my project from 5.3.8 and running into problems
using modules.
For the source directory structure I have tried:

src/main/resources/META-INF/modules/mymodule/mymodule.js AND
src/main/modules/mymodule/mymodule.js

and for the deployment directory structure I have tried this:

WEB-INF/classes/META-INF/modules/login/login.js AND
WEB-INF/classes/mymodule/mymodule.js

In both cases I get:
[Error] Failed to load resource: the server responded with a status of
404 (Not Found) (login.js, line 0)
[Error] RequireJS error: scripterror: Script error for: login
http://requirejs.org/docs/errors.html#scripterror, modules login
     (anonymous function) (console.js, line 104)
     onError (console.js, line 133)
     onError (require.js, line 537)
     onScriptError (require.js, line 1681)

Thanks for your help!
Andreas







---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Tapestry 5.4 Beta 22: Supposed directory structure for modules used by requirejs

Chris Poulsen
Modules should end up in:

<classpath>/META-INF/modules  (classpath in your case being WEB-INF/classes
)

You haven't shared anything about how you attempt to reference the files so
its hard to help you.

To include the module in: WEB-INF/classes/META-INF/modules/login/login.js

You could do @Import( module = "login/login" ) in your page or in a
component on the page.

HTH

--
Chris


On Thu, Feb 5, 2015 at 9:52 AM, samt & sonders <[hidden email]>
wrote:

> hi,
>
> I'm trying to upgrade my project from 5.3.8 and running into problems
> using modules.
> For the source directory structure I have tried:
>
> src/main/resources/META-INF/modules/mymodule/mymodule.js AND
> src/main/modules/mymodule/mymodule.js
>
> and for the deployment directory structure I have tried this:
>
> WEB-INF/classes/META-INF/modules/login/login.js AND
> WEB-INF/classes/mymodule/mymodule.js
>
> In both cases I get:
> [Error] Failed to load resource: the server responded with a status of 404
> (Not Found) (login.js, line 0)
> [Error] RequireJS error: scripterror: Script error for: login
> http://requirejs.org/docs/errors.html#scripterror, modules login
>     (anonymous function) (console.js, line 104)
>     onError (console.js, line 133)
>     onError (require.js, line 537)
>     onScriptError (require.js, line 1681)
>
> Thanks for your help!
> Andreas
>
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Tapestry 5.4 Beta 22: Supposed directory structure for modules used by requirejs

JumpStart
Or, as I prefer these days because in this style you can easily modify it to add parameters or invoke particular functions:

        void afterRender() {
                javaScriptSupport.require("login/login");
        }

Geoff

On 5 Feb 2015, at 8:01 pm, Chris Poulsen <[hidden email]> wrote:

> Modules should end up in:
>
> <classpath>/META-INF/modules  (classpath in your case being WEB-INF/classes
> )
>
> You haven't shared anything about how you attempt to reference the files so
> its hard to help you.
>
> To include the module in: WEB-INF/classes/META-INF/modules/login/login.js
>
> You could do @Import( module = "login/login" ) in your page or in a
> component on the page.
>
> HTH
>
> --
> Chris
>
>
> On Thu, Feb 5, 2015 at 9:52 AM, samt & sonders <[hidden email]>
> wrote:
>
>> hi,
>>
>> I'm trying to upgrade my project from 5.3.8 and running into problems
>> using modules.
>> For the source directory structure I have tried:
>>
>> src/main/resources/META-INF/modules/mymodule/mymodule.js AND
>> src/main/modules/mymodule/mymodule.js
>>
>> and for the deployment directory structure I have tried this:
>>
>> WEB-INF/classes/META-INF/modules/login/login.js AND
>> WEB-INF/classes/mymodule/mymodule.js
>>
>> In both cases I get:
>> [Error] Failed to load resource: the server responded with a status of 404
>> (Not Found) (login.js, line 0)
>> [Error] RequireJS error: scripterror: Script error for: login
>> http://requirejs.org/docs/errors.html#scripterror, modules login
>>    (anonymous function) (console.js, line 104)
>>    onError (console.js, line 133)
>>    onError (require.js, line 537)
>>    onScriptError (require.js, line 1681)
>>
>> Thanks for your help!
>> Andreas
>>
>>
>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>

Reply | Threaded
Open this post in threaded view
|

Re: Tapestry 5.4 Beta 22: Supposed directory structure for modules used by requirejs

samt & sonders
Thanks Geoff and Chris for your quick response. Much appreciated!

In fact I referenced it like this:
javaScriptSupport.require("login") because I thought the module name is a reference to the folder.

javaScriptSupport.require("login/login") works fine.

Thank you so much!
Andreas

5 Feb 2015 16:07
Or, as I prefer these days because in this style you can easily modify it to add parameters or invoke particular functions:

void afterRender() {
javaScriptSupport.require("login/login");
}

Geoff



5 Feb 2015 16:01
Modules should end up in:

<classpath>/META-INF/modules (classpath in your case being WEB-INF/classes
)

You haven't shared anything about how you attempt to reference the files so
its hard to help you.

To include the module in: WEB-INF/classes/META-INF/modules/login/login.js

You could do @Import( module = "login/login" ) in your page or in a
component on the page.

HTH

5 Feb 2015 15:52
hi,

I'm trying to upgrade my project from 5.3.8 and running into problems using modules.
For the source directory structure I have tried:

src/main/resources/META-INF/modules/mymodule/mymodule.js AND
src/main/modules/mymodule/mymodule.js

and for the deployment directory structure I have tried this:

WEB-INF/classes/META-INF/modules/login/login.js AND
WEB-INF/classes/mymodule/mymodule.js

In both cases I get:
[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (login.js, line 0)
[Error] RequireJS error: scripterror: Script error for: login
http://requirejs.org/docs/errors.html#scripterror, modules login
    (anonymous function) (console.js, line 104)
    onError (console.js, line 133)
    onError (require.js, line 537)
    onScriptError (require.js, line 1681)

Thanks for your help!
Andreas







---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]