#16655 closed defect (fixed)
[patch] access to undefined property in writeOptimized.js
Reported by: | Michael Frischeisen-Koehler | Owned by: | dylan |
---|---|---|---|
Priority: | undecided | Milestone: | 1.9.8 |
Component: | BuildSystem | Version: | 1.8.3 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
When trying to build a custom layer, the following error occurs:
[exec] js: "<eval'ed string>#1(Function)#1(eval)", line 308: uncaught JavaScript runtime exception: TypeError: Cannot read property "copyright" from undefined
This seems to occur when the "synthetic" nls files are processed in writeOptimized.js. It happens when the first i18n resource for the custom layer is processed (customLayer_ar.js). The pack property of the processed resource is undefined, hence the error occurs when trying to pass resource.pack.copyright to the compile function:
return compile(resource, resource.getText(), resource.pack.copyright, bc.optimize, callback);
Replacing this with
var copyright = resource.pack ? resource.pack.copyright : bc.copyright; return compile(resource, resource.getText(), copyright, bc.optimize, callback);
solved the problem for me, however I'm not sure whether something else is broken that leads to the pack property not being defined.
This problem has been discussed in the dojo interest mailing list, however it wasn't solved.
Attachments (1)
Change History (18)
comment:1 Changed 8 years ago by
comment:2 Changed 8 years ago by
Milestone: | tbd → 1.9 |
---|---|
Status: | new → assigned |
comment:3 Changed 8 years ago by
please could this be solved in trunk ? writeOptimized.js was reworked, but this issue is still not fixed
thank you very much
Changed 8 years ago by
Attachment: | copyright.patch added |
---|
[Patch][CLA]this patch for me on current master
comment:4 Changed 8 years ago by
Resolution: | → worksforme |
---|---|
Status: | assigned → closed |
I can't duplicate the NLS problem. If it is really related to #16106, then maybe it's solved. Otherwise, please reduce to a small test case and post.
Thanks!
comment:5 Changed 8 years ago by
I have modified dojo-boilerplate project https://github.com/k2s/dojo-boilerplate/commit/244eeccad2825b8b03a5a701781d18f575030cfa
this should end with error:
git clone git://github.com/k2s/dojo-boilerplate.git cd dojo-boilerplate git submodule update --init --recursive ./build.sh
comment:6 Changed 8 years ago by
this ticket should not be closed
could this pls. be fixed until 1.9 release ? I think, my example is easy to use and to see that this problem really exists and to test if provided patch is ok to be included to 1.9.
I will do my best to support you if there are still open questions.
thank you very much
comment:7 Changed 8 years ago by
I am seeing the same problem, however only if the output layer location is different than the source folder.
So for example, the error will occur if you try to create a layer like this:
layers: { "output/engine":{ include: [ "engine/myWidget" ] }
But you will see no error if you rename your layer like this:
layers: { "engine/engine":{ include: [ "engine/myWidget" ] }
Hope this helps...
comment:8 Changed 8 years ago by
I met the same situation when I try to build my project with dojo.
starting writing resources... [TypeError: Cannot read property 'copyright' of undefined] TypeError: Cannot read property 'copyright' of undefined at Array.0 (/workspace/project/web/trunk/lib/util/build/transforms/writeOptimized.js:26:85) at advance (/workspace/project/web/trunk/lib/util/build/main.js:126:25) at returnFromAsyncProc (/workspace/project/web/trunk/lib/util/build/main.js:105:5) at /workspace/project/web/trunk/lib/util/build/transforms/writeAmd.js:353:5 at /workspace/project/web/trunk/lib/util/build/node/fs.js:23:9 at Object.oncomplete (fs.js:107:15)
I'v just download the dojo 1.9.1 SDK. This patch works for me.
layers looks like this.
layers : { 'web/startup' : { include : [ 'dojo/dojo' ], boot : true, customBase : true } }
comment:9 Changed 7 years ago by
I've the same issue also with dojo 1.9.3 SDK.... Only If i patch the writeOptimized.js file i'm able to execute the custom build....
comment:10 Changed 7 years ago by
We have the same issue with dojo 1.9.2 SDK (also traceable with 1.10.0). The proposed patch fixed the issue. We would really appreciate if you can solve this in the next dojo 1.9/1.10 release. Thanks!
comment:11 Changed 7 years ago by
Milestone: | 1.9 → tbd |
---|---|
Resolution: | worksforme |
Status: | closed → reopened |
Summary: | build: access to undefined property in writeOptimized.js → [patch] access to undefined property in writeOptimized.js |
Reopening as test case provided (https://github.com/k2s/dojo-boilerplate/commit/244eeccad2825b8b03a5a701781d18f575030cfa), and trivial patch also provided.
comment:12 Changed 5 years ago by
Milestone: | tbd → 1.11 |
---|---|
Owner: | changed from Rawld Gill to dylan |
Status: | reopened → assigned |
comment:13 Changed 5 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:16 Changed 5 years ago by
Sorry this took so long to land. It's in master and backported to 1.10.x and 1.9.x
comment:17 Changed 5 years ago by
Milestone: | 1.11 → 1.9.8 |
---|
I have the same issue and the proposed patch by micschro fixed the issue.
Without this fix I am not able to build my project.