Package: `api.export` doesn't export to client

Hey there!
My Meteor app uses a package-only structure, and now I’m about to add a collection-fs package, that manages my files.

For the collection, I’m adding two files, one for the client, one for the server. Both define a PDFs variable, which I then export. The problem is, that I get the var on the server, but not on the client.

This is my code:

// package.js

Package.onUse(function (api) {
  var c = 'client';
  var s = 'server';

  // Core Dependencies

  // Atmosphere Dependencies

  // Collections
  api.addFiles('collections/pdfs/', c);
  ], s);

  // Methods
  api.addFiles('methods/pdfs/', s);

  // Exports

### Client (collections/pdfs/ ###

PDFs = new FS.Collection 'pdfs',
  stores: [
    new FS.Store.S3 'pdfs'

### Server (collections/pdfs/ ###

access =

PDFs = new FS.Collection 'pdfs',
  stores: [
    new FS.Store.S3 'pdfs',
      bucket: 'app-development'
      accessKeyId: access.accessKeyId
      secretAccessKey: access.secretAccessKey
      region: 'eu-central-1'

I’ve not converted to JavaScript here, because I don’t know if it’s some Meteor - CoffeeScript thing causing my problem.

When I open the browser console and run PDFs, expecting an Object, I get undefined. Package['collection-fs'].PDFs however returns it correctly.

Why doesn’t my PDFs object get added to the window namespace?

It seems like PDFs should be global. I’m not sure why it’s not on first glance.

Are you sure PDFs is properly initialized when you are doing new FS.Collection ‘pdfs’ ?
Have you tried adding a console.log after that ?

I have had a similar problem, and asked this SO question:

The answer for me was that debugOnly was clobbering the exports- is the package exporting PDFs debugOnly ?