Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Support
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
pagedjs
pagedjs
  • Project
    • Project
    • Details
    • Activity
    • Releases
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 145
    • Issues 145
    • List
    • Boards
    • Labels
    • Milestones
  • Merge Requests 8
    • Merge Requests 8
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Tools
  • pagedjspagedjs
  • Issues
  • #110

Closed
Open
Opened Apr 17, 2019 by Julie Blanc@JulieBlanc
  • Report abuse
  • New issue
Report abuse New issue

Import preview from esmodule

Several problems with the import of the es module:

1/ Importing the preview module from npm's localhost doesn't work but it works from the unpkg version

The following code don't work:

import { Previewer } from 'http://localhost:9090/dist/paged.esm.js';

Error in the console: Uncaught TypeError: Failed to resolve module specifier "event-emitter". Relative references must start with either "/", "./", or "../". i

2/ Each element of the pages is preceded by a <html> tag.

Capture_d_écran_2019-04-17_à_15.54.48

3/ The content is rendered twice. Once in the template pages and a second time outside the pages.

Capture_d_écran_2019-04-17_à_15.57.50

Test file: esm-test.html

Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
3
Labels
Priority To Do esmodules
Assign labels
  • View project labels
Reference: tools/pagedjs#110