Bug Tracker

Ticket #14548 (closed bug: fixed)

Opened 8 months ago

Last modified 8 months ago

npm jQuery does not have a main module

Reported by: domenic@… Owned by: timmywil
Priority: blocker Milestone: 1.11/2.1
Component: core Version: 2.1.0-beta1
Keywords: Cc:
Blocking: Blocked by:

Description

Because jquery's package.json does not have a "main" field, it's not possible to require jQuery.

Steps to reproduce:

npm install jquery@2.1.0-beta2 echo "var $ = require('jquery');" > test.js node test.js

Throws error: cannot find module 'jquery'.

I'd suggest exposing dist/jquery.js as the main module.

Change History

comment:1 Changed 8 months ago by timmywil

  • Owner set to timmywil
  • Priority changed from undecided to blocker
  • Status changed from new to assigned
  • Component changed from unfiled to core
  • Milestone changed from None to 1.11/2.1

I absolutely agree we need a main property. I seem to recall that we had this property at one point and it was removed, but that could be totally wrong.

comment:2 Changed 8 months ago by timmywil

For now, require('jquery/dist/jquery') or require('jquery/src/someModule') is a workaround.

comment:3 Changed 8 months ago by Timmy Willison

  • Status changed from assigned to closed
  • Resolution set to fixed

Fixes #14548. Add main property to package.json

Changeset: 6fde9752599f035da5e328b54a1e23e075e4ad45

Note: See TracTickets for help on using tickets.