Skip to content

[BUG] Can't resolve 'styles/annotations.css' when importing BokehJS #10172

@appleparan

Description

@appleparan

ALL software version info (bokeh, python, notebook, OS, browser, any other relevant packages)

  • bokeh : 2.1.0
  • node : 14.4.0
  • react : 16.13.1
  • typescript : 3.9.5
  • OS : Ubuntu 18.04 in WSL2

Description of expected behavior and the observed behavior

An error occurred when just importing bokehJS in webpack based JSX code (React). It might be revisit of #8197 or webpack confused about .css.js (style/annotation.css.js )

Check this:

import annotations_css from "styles/annotations.css"

Complete, minimal, self-contained example code that reproduces the issue

Simple Repo to reproduce

What I did;

$ npx create-react-app myapp
$ cd myapp
$ npm i @bokeh/bokehjs

then add import * as Bokeh from "@bokeh/bokehjs"; in App.js.

Stack traceback and/or browser JavaScript console output

./node_modules/@bokeh/bokehjs/build/js/lib/models/annotations/annotation.js
Module not found: Can't resolve 'styles/annotations.css' in 'mydirectories/node_modules/@bokeh/bokehjs/build/js/lib/models/annotations'

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions