I have two projects, once is a traditional CanJS + StealJS application and the other a DoneJS application (from scratch).
I’m trying to get TinyMCE loaded.
I get a similar error in either project:
TypeError: Error loading "node_modules/tinymce/tinymce" at http://10.0.62.131:8080/node_modules/tinymce/tinymce.js(…) "TypeError: Error loading "node_modules/tinymce/tinymce" at http://10.0.62.131:8080/node_modules/tinymce/tinymce.js
Error loading "node_modules/tinymce/tinymce" from "tiny@0.0.0#index.stache!done-autorender@0.7.3#autorender" at http://10.0.62.131:8080/src/index.stache
AMD module node_modules/tinymce/tinymce did not define
For the traditional stealjs app, I have defined an entry under system.meta
importing in index.stache as <can-import from="node_modules/tinymce/"/>
Full Error:
Potentially unhandled rejection [3] TypeError: Error loading "tiny@0.0.0#index.stache!done-autorender@0.7.3#autorender" at file:/home/pault/tiny/src/index.stache
Error evaluating file:/home/pault/tiny/node_modules/tinymce/tinymce.js
Cannot read property 'href' of undefined
at Object.EditorManager.setup (evalmachine.<anonymous>:38682:39)
at each (evalmachine.<anonymous>:39231:16)
at evalmachine.<anonymous>:45:29
at require (evalmachine.<anonymous>:28:12)
at define (evalmachine.<anonymous>:44:3)
at evalmachine.<anonymous>:38539:1
at evalmachine.<anonymous>:45960:3
at doEval (/home/pault/tiny/node_modules/steal/node_modules/steal-systemjs/dist/system.src.js:2041:10)
at __eval (/home/pault/tiny/node_modules/steal/node_modules/steal-systemjs/dist/system.src.js:1958:7)
at Loader.exec [as __exec] (/home/pault/tiny/node_modules/steal/node_modules/steal-systemjs/dist/system.src.js:339:5)
Ah, you shouldn’t put node_modules in your node_modules import. You’ll notice we don’t do that in either of the guides or bitballs.
Simply write <can-import from="tinymce"/>
This might not fix your current problem, but you should import using package names. Then you should be able to configure system.meta the way I described above.
I had originally tried that, but then I get the following error:
Error loading "tinymce@4.3.8#index" from "tiny@0.0.0#index.stache!done-autorender@0.7.3#autorender" at file:/home/pault/tiny/src/index.stache
ENOENT, open '/home/pault/tiny/node_modules/tinymce/index/index.js'
The Only way I could get it to load that way is to change the import line to
<can-import from="tinymce/tinymce.js"/>
And then I get the href error again.
I almost forgot to mention an important detail. We’ve been running this in our can/steal project in live for months now. This is only happening with the latest steal as I’m trying to upgrade to the latest libraries. Works fine with steal 0.12.7 but failes with 0.15.3. (again, this particular example is not a donejs project).
var self = this, baseURL, documentBaseURL, suffix = "", preInit, src;
// Get base URL for the current document
documentBaseURL = document.location.href;
This is breaking during server side rendering or something in node? Why would document.location.href not exist?