Giter Club home page Giter Club logo

Comments (8)

chuckdumont avatar chuckdumont commented on August 16, 2024

Are you seeing this error when building or when try to running the built code? What target environment are you running in. Note that dojo-webpack-plugin does not support node.js as a target platform. Only browser platforms are supported, although you could probably get it to work with a browser emulator such as window. That's what this package uses for unit tests.

from dojo-webpack-plugin.

BKrewer avatar BKrewer commented on August 16, 2024

I get error in compilation when running npx webpack --config webpack.config.js. I really need it for the web, so I changed the target to "web" in webpack.config file and the same error follows.
Would there be any other example configuration besides the loaderConfig file or webpack.config.js?

from dojo-webpack-plugin.

chuckdumont avatar chuckdumont commented on August 16, 2024

I don't think it's the config file. Could you post a test case that reproduces the problem?

from dojo-webpack-plugin.

henry-filosa avatar henry-filosa commented on August 16, 2024

Hi, I'm also having the same exact issue. In our case, this is in conjunction with the Cypress/webpack-preprocessor.

ReferenceError: location is not defined
    at /.../target/generated-webapp/libs/dojo-release-1.16.4/dojo/dojo.js:8:2740
    at Object.<anonymous> (/.../target/generated-webapp/libs/dojo-release-1.16.4/dojo/dojo.js:8:22014)
    at DojoLoaderPlugin.createLoaderScope (/.../node_modules/dojo-webpack-plugin/lib/DojoLoaderPlugin.js:167:94)
    at Hook.eval (eval at create (/.../node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:7:16)
    at Hook.CALL_DELEGATE [as _call] (/.../node_modules/tapable/lib/Hook.js:14:14)
    at /.../node_modules/dojo-webpack-plugin/lib/DojoLoaderPlugin.js:206:68
    at /.../.cache/Cypress/8.3.1/Cypress/resources/app/packages/server/node_modules/graceful-fs/graceful-fs.js:90:16
    at FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:63:3)

Please let me know of any information that could be useful for figuring this out (note ellipses for redactions)

from dojo-webpack-plugin.

henry-filosa avatar henry-filosa commented on August 16, 2024

I noticed this line on the readme: "The Dojo loader builder requires that the Dojo util directory is a sibling of the dojo directory and is named either util or dojo-util." We do not have a util directory in our dojo package. However, would we get to this point in the process if that was the issue?

from dojo-webpack-plugin.

chuckdumont avatar chuckdumont commented on August 16, 2024

We do not have a util directory in our dojo package

dojo-util is not in the dojo package. It is a peer dependency. So dojo-util should be in node_modules, along-side dojo.

I think your problem is that you're using a release version of the dojo loader. You need to use a source version of dojo, or else, a version built by dojo-webpack-plugin. See Building the Dojo loader. Add dojo and dojo-util (along with digit and dojox if you use those) as dependencies in your package.json and use that to build instead of the release code.

from dojo-webpack-plugin.

chuckdumont avatar chuckdumont commented on August 16, 2024

Just to clarify. Building your own dojo loader is not an alternative to building against the dojo sources. Whether or not you allow dojo-webpack-plugin to build the loader or you use a pre-built loader, you still need to run webpack against the dojo source code and not a release build.

from dojo-webpack-plugin.

henry-filosa avatar henry-filosa commented on August 16, 2024

Thanks for responding. That clears things up, we weren't managing our dojo packages with npm. Downloaded the necessary libraries and instead are having issues with publicPath, but that's a battle for another day.

from dojo-webpack-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.