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

uikit-polyfill not found #1104

Closed
jensgro opened this issue Nov 26, 2019 · 12 comments · Fixed by #1105 or #1151
Closed

uikit-polyfill not found #1104

jensgro opened this issue Nov 26, 2019 · 12 comments · Fixed by #1105 or #1151
Assignees

Comments

@jensgro
Copy link

jensgro commented Nov 26, 2019

I am using the newest Pattern Lab Node on Windows , with Node v12.13.0, installed today via command line.
I installed starterkit-handlebars-vanilla with the uikit-workshop and in another folder the starterkit-mustache-demo with the uikit-workshop. Both installed without warnings and were fired up with pl:serve.

Expected Behavior

Show the patternlab in every modern browser.

Actual Behavior

I cannot see anything in Edge. Error message is:

Could not find uikit with name uikit-polyfills defined within patternlab-config.json, or it is not enabled.

I cannot find where the polyfill should be noted in the config. The project can be found in node_modules.

How can I activate the polyfills so that I can see the patterns in Edge, too?

@sghoweri
Copy link
Contributor

@jensgro could you take a peek at your node_modules/@pattern-lab folder and double-check three things?

  1. What’s the version listed out in the uikit-workshop folder’s package.json?

  2. Is there a @pattern-lab/uikit-polyfills package listed out in that same package.json folder as a dependency?

  3. There’s a node_modules/@pattern-lab/uikit-polyfills folder installed locally, yes?

Let me know — we’ll get to the bottom of what’s going on here!

@sghoweri
Copy link
Contributor

PS. we just released the latest version of UIKit (v5.4.0) so you should also try updating to see if you're still seeing this particular issue!

@jensgro
Copy link
Author

jensgro commented Nov 26, 2019

Hi @sghoweri thanks for your answer.

  1. The uikit-workshop has the version 5.3.3
  2. The uikit-workshop has the polyfills as a dependency
  3. The folder is in the node_modules

I updated the project, Now I do have UIKit 5.4.0 but nothing changed. The page is empty in Edge.

@sghoweri
Copy link
Contributor

Hmmm. What version of Edge are you using?

@sghoweri
Copy link
Contributor

I’m assuming this Windows 10, correct?

@sghoweri
Copy link
Contributor

Actually, scratch that. Was able to replicate the issue locally — will try to get a fix in ASAP!

@sghoweri
Copy link
Contributor

@jensgro try pulling down the latest UIKit version (v5.4.1) when you get a chance — this should be all set with that patch release!

@jensgro
Copy link
Author

jensgro commented Nov 29, 2019

@sghoweri Perfect! It works in Edge and in IE11, too. Thanks a lot for your fast reaction!

@karlosmrez
Copy link

Hi,

it doesn´t works for me:

UiKit: 5.5.0
Gulp: 4.0.2
Node: 13.6.0

Error:

$ gulp patternlab:serve
Pattern Lab Node v5.4.0
Pattern Engine mustache: good to go
Could not find uikit with name uikit-polyfills defined within patternlab-config.json, or it is not enabled.
assert.js:386
    throw err;
    ^

AssertionError [ERR_ASSERTION]: Task function must be specified
    at Gulp.set [as _setTask] (D:\10_Projekte\ui-patternlab-examples\node_modules\undertaker\lib\set-task.js:10:3)
    at Gulp.task (D:\10_Projekte\ui-patternlab-examples\node_modules\undertaker\lib\task.js:13:8)
    at Object.<anonymous> (D:\10_Projekte\ui-patternlab-examples\gulpfile.js:68:6)
    at Module._compile (internal/modules/cjs/loader.js:1144:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1164:10)
    at Module.load (internal/modules/cjs/loader.js:993:32)
    at Function.Module._load (internal/modules/cjs/loader.js:892:14)
    at Module.require (internal/modules/cjs/loader.js:1033:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at execute (D:\10_Projekte\ui-patternlab-examples\node_modules\gulp\node_modules\gulp-cli\lib\versioned\^4.0.0\index.js:36:18) {
  generatedMessage: false,
  code: 'ERR_ASSERTION',
  actual: false,
  expected: true,
  operator: '=='
}

@hmalaud
Copy link

hmalaud commented Feb 21, 2020

I get the same error on compile
UiKit: 5.5.0
Gulp: 4.0.2
Node: 12.10.0

@bmuenzenmeyer
Copy link
Member

bmuenzenmeyer commented Feb 21, 2020

the warning seen here is different than the original OP - this internal package uikit-polyfills is tripping some logic built into loaduikits to look at node_modules for packages prefixed with uikit-

so uikit-polyfills (the util) looks like uikit-workshop (the uikit) and we try to load it.

looking at the code in question - this only emits a warning when using node directly.

https://github.com/pattern-lab/patternlab-node/blob/dev/packages/core/src/lib/loaduikits.js#L56

λ npm run pl:build

> 1104@1.0.0 pl:build D:\src\test\1104
> patternlab build --config ./patternlab-config.json

Pattern Lab Node v5.7.0
Pattern Engine handlebars: good to go
Pattern Engine mustache: good to go
Could not find uikit with name uikit-polyfills defined within patternlab-config.json, or it is not enabled.
Built pattern: atoms-colors
Built pattern: atoms-brand-colors
Built pattern: atoms-neutral-colors
Built pattern: atoms-utility-colors
Built pattern: atoms-fonts
Built pattern: atoms-font-families
Built pattern: atoms-font-sizes
Built pattern: atoms-headings
Built pattern: atoms-paragraph
Built pattern: atoms-blockquote
Built pattern: atoms-inline-elements
Built pattern: atoms-hr
Built pattern: atoms-text-input
Built pattern: atoms-textarea
Built pattern: atoms-select
Built pattern: atoms-checkbox
Built pattern: atoms-radio-button
Built pattern: atoms-card-image
Built pattern: atoms-gallery-image
Built pattern: atoms-gallery-thumb
Built pattern: atoms-icon
Built pattern: atoms-icons
Built pattern: atoms-logo
Built pattern: molecules-card
Built pattern: molecules-button
Built pattern: molecules-checkbox-field
Built pattern: molecules-inline-checkbox
Built pattern: molecules-radio-field
Built pattern: molecules-search-form
Built pattern: molecules-select-field
Built pattern: molecules-text-field
Built pattern: molecules-textarea-field
Built pattern: molecules-logo
Built pattern: molecules-grid
Built pattern: molecules-grid-item
Built pattern: molecules-layout-container
Built pattern: molecules-footer-nav
Built pattern: molecules-primary-nav
Built pattern: molecules-page-header
Built pattern: organisms-footer
Built pattern: organisms-header
Built pattern: organisms-card-list
Built pattern: organisms-section
Built pattern: organisms-table
Built pattern: organisms-text-passage
Built pattern: templates-card-list
Built pattern: templates-page
Built pattern: pages-blog-post
Built pattern: pages-card-page
Omitting atoms-colors from styleguide patterns because it has an underscore prefix.
Built Pattern Lab front end
⊙ patternlab → build: Yay, your Pattern Lab project was successfully built ☺

I see that in a gulp environment, this errors. I don't know what assert.js or undertaker do 🤷‍♂ do all warnings cause errors that stop gulp? or just this one?

In the new version of core there will be no inferring of modules from node_modules, only from config

this could be fixed by (in order of preference)

  • filtering out uikit-polyfills in our initial search
  • not throwing a warning at all
  • changing the name of the package

@ringods
Copy link
Contributor

ringods commented Mar 28, 2020

Posting this for other users using Yarn.

I bumped into this error using Yarn v1 (Classic) in a repository with workspaces. To get this working, I had to configure the nohoist option so the requried packages are in a node_modules folder within the respective workspace (package) needing them instead of all in the top level node_modules folder.

Here is how the workspaces section in my package.json looks:

  "workspaces": {
    "packages": [
      "packages/*"
    ],
    "nohoist": [
      "**/@pattern-lab/cli",
      "**/@pattern-lab/engine-*",
      "**/@pattern-lab/uikit-*"
    ]
  },

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