Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows long path issue with Angular and Karma #250

Closed
arbitrary-user-name opened this issue Jan 19, 2021 · 1 comment
Closed

Windows long path issue with Angular and Karma #250

arbitrary-user-name opened this issue Jan 19, 2021 · 1 comment

Comments

@arbitrary-user-name
Copy link

I tried to create a pact test for an Angular project with Karma the first time. However, I run into the problem that Windows has a default path length limit of 260:

Pact Binary Error: choosen_project_path/node_modules/@pact-foundation/pact-node/standalone/win32-1.88.3/pact/lib/vendor/ruby/2.2.0/gems/pact-mock_service-3.6.2/lib/pact/mock_service/request_handlers/interaction_post.rb:1:in require': cannot load such file -- pact/mock_service/request_handlers/base_administration_request_handler (LoadError)

If I move the project to a shallower path the error is gone. Since the project is part of a larger set up with fixed directory structure this is no reliable solution for our team. Unfortunately, enabling windows long paths in the registry did not fix the problem even though the documentation on https://www.npmjs.com/package/@pact-foundation/pact-node#windows-issues suggests otherwise.

I am using Microsoft Windows 10 (build 18363). The problem can be reproduced with a dummy project set up as follows:

  • „ng new pact-project“ via angular cli
  • npm install --save-dev @pact-foundation/karma-pact @pact-foundation/pact-node
  • added in the karma.conf.js:
 frameworks: ['pact'],
 plugins: [
   require('@pact-foundation/karma-pact')
 ],
 pact: [
   {
     cors: true,
     port: 1234,
   }
 ]
  • Running ng test yields the above error.

Thank you

@mefellows
Copy link
Member

Thanks, this is a known issue. See also #101 pact-foundation/pact-js-cli#6.

You may want to have a look at trying out our new beta version of Pact: https://github.com/pact-foundation/pact-js/tree/feat/v3.0.0. It doesn't support karma (yet) but the long path issue is not longer an issue with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants